Created
November 15, 2017 18:21
-
-
Save TheFrozenFire/2f0ebd7b3c08f259ed015661af06da3d to your computer and use it in GitHub Desktop.
Ansible from virtualenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
if [ ! -d ${DIR}/ansible-install/ENV ]; then ( ${DIR}/ansible-install/setup.sh ); fi | |
if [ -z ${ANSIBLE_CONFIG+x} ]; then export ANSIBLE_CONFIG="${DIR}/ansible-install/ansible.cfg"; fi | |
if [ -z ${ANSIBLE_NO_GCLOUD+x} ]; then ${DIR}/ansible-install/setup-gcloud.sh; fi | |
source ${DIR}/ansible-install/ENV/bin/activate | |
(cd ${DIR} && exec ansible "$@") | |
EXIT_CODE=$? | |
deactivate | |
exit ${EXIT_CODE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-r requirements.txt | |
ansible-lint == 3.4.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible == 2.3.0 | |
ansible-vault >= 1.0.5, < 1.1 | |
apache-libcloud >= 0.13 | |
backports.ssl-match-hostname; python_version < '3.2' | |
setuptools >= 34.0 | |
jq >= 0.1.6 | |
kazoo >= 2.1 | |
dnspython | |
boto | |
boto3 | |
botocore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ "$(gcloud auth list --format=json)" == "[]" ]; then | |
echo "No gcloud authorization detected. Initializing gcloud." | |
echo "Set ANSIBLE_NO_GCLOUD=true to disable this behaviour." | |
echo | |
gcloud init | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
virtualenv --prompt="CallFire Ansible" "${DIR}/ENV" | |
source ${DIR}/ENV/bin/activate | |
pip install --upgrade pip | |
pip install -r ${DIR}/requirements${SETUP_ENVIRONMENT:+"-${SETUP_ENVIRONMENT}"}.txt | |
deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
if [ ! -d ${DIR}/ansible-install/ENV ]; then ( ${DIR}/ansible-install/setup.sh ); fi | |
if [ -z ${ANSIBLE_CONFIG+x} ]; then export ANSIBLE_CONFIG="${DIR}/ansible-install/ansible.cfg"; fi | |
if [ -z ${ANSIBLE_NO_GCLOUD+x} ]; then ${DIR}/ansible-install/setup-gcloud.sh; fi | |
source ${DIR}/ansible-install/ENV/bin/activate | |
(cd ${DIR} && exec ansible-playbook "$@") | |
EXIT_CODE=$? | |
deactivate | |
exit ${EXIT_CODE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
if [ ! -d ${DIR}/ansible-install/ENV ]; then ( ${DIR}/ansible-install/setup.sh ); fi | |
if [ -z ${ANSIBLE_CONFIG+x} ]; then export ANSIBLE_CONFIG="${DIR}/ansible-install/ansible.cfg"; fi | |
source ${DIR}/ansible-install/ENV/bin/activate | |
(cd ${DIR} && exec ansible-vault "$@") | |
EXIT_CODE=$? | |
deactivate | |
exit ${EXIT_CODE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment