Skip to content

Instantly share code, notes, and snippets.

@vadikgo
Created September 10, 2019 19:00
Show Gist options
  • Save vadikgo/96bf87163961c396d5a9aaf2c9d879bf to your computer and use it in GitHub Desktop.
Save vadikgo/96bf87163961c396d5a9aaf2c9d879bf to your computer and use it in GitHub Desktop.
Build portable ansible virtualenv
#!/bin/bash
set -e
ansible_tool() {
ver=$1
tag=$(echo ${ver} | awk -F . '{print $1$2}')
virtualenv ansible${tag}
source ansible${tag}/bin/activate
python -m pip install ansible==${ver} \
lxml xmltodict python_ntlm docker pywinrm==0.2.2 pyzabbix requests-credssp jmespath \
openshift==0.8.6 botocore==1.10.83 boto3==1.7.83
virtualenv --relocatable ansible${tag}
tar -czpf ~/ansible${ver}.tar.gz ansible${tag}
deactivate
}
yum install python-virtualenv python-pip -y
# Jenkins UATS/PPRB
#ansible_tool "2.8.2"
#ansible_tool "2.7.11"
#ansible_tool "2.6.10"
#ansible_tool "2.5.13"
#ansible_tool "2.4.6.0"
#ansible_tool "2.3.3.0"
# Jenkins EFS
ansible_tool "2.7.5"
ansible_tool "2.6.2"
ansible_tool "2.5.7"
ansible_tool "2.4.6.0"
ansible_tool "2.3.2.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment