1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

handle apt upgrades from 2.2.1 to 2.4.0

This commit is contained in:
Jerry Vonau 2017-09-27 15:38:00 -05:00
parent f8d663d713
commit 88cd7d0fb6

View file

@ -5,13 +5,15 @@ URL="NA"
# TODO add check for version - to revese patching if upgrading # TODO add check for version - to revese patching if upgrading
if [ $(which ansible-playbook) ]; then if [ $(which ansible-playbook) ]; then
VER=`ansible --version|head -n 1|cut -f 2 -d " "` VER=`ansible --version|head -n 1|cut -f 2 -d " "`
if [ $VER="2.2.0.0" ]; then GOOD_VER="$VER | grep 2.4 | wc -l"
if [ $VER = "2.2.0.0" ]; then
echo "Ansible $VER installed updating to 2.4.0" echo "Ansible $VER installed updating to 2.4.0"
pip install --upgrade ansible==2.4.0 --disable-pip-version-check pip install --upgrade ansible==2.4.0 --disable-pip-version-check
# sed -i 's/StrictVersion/LooseVersion/g' /usr/lib/python2.7/dist-packages/ansible/modules/core/web_infrastructure/htpasswd.py
fi
exit 0 exit 0
fi
fi fi
# TODO add check for version - to revese patching if upgrading # TODO add check for version - to revese patching if upgrading
#if [ $(which ansible-playbook) ]; then #if [ $(which ansible-playbook) ]; then
# VER=`ansible --version|head -n 1|cut -f 2 -d " "` # VER=`ansible --version|head -n 1|cut -f 2 -d " "`
@ -93,21 +95,20 @@ fi
### start ansible pip install TODO add venv location /opt/iiab/anisble ### start ansible pip install TODO add venv location /opt/iiab/anisble
if [ $FAMILY = "olpc" ]; then if [ $FAMILY = "olpc" ]; then
pip install ansible==2.2.1 --disable-pip-version-check pip install ansible==2.4.0 --disable-pip-version-check
VER=`ansible --version|head -n 1|cut -f 2 -d " "` VER=`ansible --version|head -n 1|cut -f 2 -d " "`
echo "ansible version installed via pip $VER" echo "ansible version installed via pip $VER"
fi fi
# TODO add check for version to skip patching # handle 2.2.1 2.2.0.0 <-> 2.4.0
# APPLY TEMPORARY PATCH if [ $FAMILY = "debian" ]; then
# https://github.com/ansible/ansible/pull/20202 if [ $GOOD_VER -lt 1 ]; then
# https://github.com/iiab/iiab/issues/249 sed -i 's/LooseVersion/StrictVersion/g' /usr/lib/python2.7/dist-packages/ansible/modules/core/web_infrastructure/htpasswd.py
#if [ $FAMILY != "redhat" ]; then apt-get -y upgrade ansible
# echo "Patching..." fi
# sed -i 's/StrictVersion/LooseVersion/g' /usr/lib/python2.7/dist-packages/ansible/modules/core/web_infrastructure/htpasswd.py fi
#fi
VER=`ansible --version|head -n 1|cut -f 2 -d " "` VER=`ansible --version|head -n 1|cut -f 2 -d " "`
echo "ansible version installed via package manager $VER" echo "Current ansible version installed is $VER"
# sample only # sample only
#if [ $FAMILY = "debian" ]; then #if [ $FAMILY = "debian" ]; then