Files
dc-deployments-automation/bin/install-ansible
2022-02-25 10:39:18 -06:00

36 lines
784 B
Bash
Executable File

#!/bin/bash
set -e
source /etc/os-release
if [[ $ID = "amzn" ]]; then
yum install -y \
python3-devel \
python3-pip \
python2-boto3 \
python2-botocore \
python-lxml
else
# FIXME: Currently assumes Debian-based
apt-get update && \
apt-get install -y \
python3-dev \
python3-pip
fi
export PATH=/usr/local/bin:$PATH
export PIP_DEFAULT_TIMEOUT=60
echo "Installing pipenv..."
pip3 install pipenv==2021.5.29
echo "Installing ansible and dependencies..."
PIPENV_NOSPIN=1 PIPENV_HIDE_EMOJIS=1 pipenv sync 2>&1 | iconv -c -f utf-8 -t ascii
if [[ $1 == "--dev" ]]; then
pipenv sync --dev
fi
echo "Installing collections from galaxy..."
pipenv run ansible-galaxy collection install -v -r requirements.yml