diff --git a/scripts/ansible b/scripts/ansible index f192876c6..de3351d12 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -2,8 +2,10 @@ # required to start loading IIAB with ansible FOUND="" URL="NA" +# TODO add check for version - to revese patching if upgrading if [ $(which ansible-playbook) ]; then - echo "Ansible installed exiting..." + VER=`ansible --version|head -n 1|cut -f 2 -d " "` + echo "Ansible $VER installed exiting..." exit 0 fi echo "Installing --- Please Wait" @@ -84,12 +86,22 @@ if [ $FAMILY = "olpc" ]; then echo "ansible version installed via pip $VER" fi +# TODO add check for version to skip patching +# APPLY TEMPORARY PATCH +# https://github.com/ansible/ansible/pull/20202 +# https://github.com/iiab/iiab/issues/249 +if [ $FAMILY != "redhat" ]; then + echo "Patching..." + sed -i 's/StrictVersion/LooseVersion/g' /usr/lib/python2.7/dist-packages/ansible/modules/core/web_infrastructure/htpasswd.py +fi +VER=`ansible --version|head -n 1|cut -f 2 -d " "` +echo "ansible version installed via package manager $VER" + +# sample only #if [ $FAMILY = "debian" ]; then # rpm -e ansible # pip install ansible==2.2.1 --disable-pip-version-check #fi -VER=`ansible --version|head -n 1|cut -f 2 -d " "` -echo "ansible version installed via package manager $VER" #if [ $FAMILY = "debian" ]; then # echo 'WARN: Trying to install ansible via pip without some dependencies'