From 54b4a3c2b09f66980217d25a2f45674e7dcb7784 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 27 Sep 2017 22:50:16 -0500 Subject: [PATCH] find unbutu as a last resort to quite looking for /etc/lsb-release - exit if version is 2.4.0.0 --- scripts/ansible | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 64a7a4370..19f54d9f6 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -9,16 +9,19 @@ if [ $(which ansible-playbook) ]; then if [ $VER = "2.2.0.0" ]; then echo "Ansible $VER installed updating to 2.4.0" pip install --upgrade ansible==2.4.0 --disable-pip-version-check - exit 0 + exit 0 + fi +# keep an eye out for 2.4.0.X in the future + if [ $VER = "2.4.0.0" ]; then + echo "Ansible $VER installed exiting..." + exit 0 fi fi # TODO add check for version - to revese patching if upgrading #if [ $(which ansible-playbook) ]; then # VER=`ansible --version|head -n 1|cut -f 2 -d " "` -# echo "Ansible $VER installed exiting..." -# exit 0 -#fi + echo "Installing --- Please Wait" if [ -f /etc/fedora-release ]; then VER=`grep VERSION_ID /etc/*elease | cut -d= -f2` @@ -51,7 +54,6 @@ if [ -f /etc/olpc-release ]; then fi if [ -f /etc/debian_version ]; then -# might pickup usbmount confirm ppa location echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" >> /etc/apt/sources.list apt-get -y install dirmngr apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 @@ -61,20 +63,6 @@ if [ -f /etc/debian_version ]; then FOUND="yes" FAMILY="debian" fi -if [ `grep -qi ubuntu /etc/lsb-release` ] || [ `grep -qi ubuntu /etc/os-release` ]; then - echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" >> /etc/apt/sources.list - apt-get -y install dirmngr - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 - apt-get -y update -# confirm PPA location -# apt-get install software-properties-common -# apt-add-repository ppa:ansible/ansible -# apt-get update - apt-get -y install ansible git python-pip python-setuptools python-wheel patch -# apt-get install ansible python-kerberos python-selinux python-winrm python-xmltodict sshpass bzip2 file findutils gzip tar unzip zip python-keyczar python-boto python-dnspython python-pyrax python-sphere - FOUND="yes" - FAMILY="debian" -fi # Has 2.2.1 if [ `grep -qi raspbian /etc/*elease` ]; then echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" >> /etc/apt/sources.list @@ -86,7 +74,22 @@ if [ `grep -qi raspbian /etc/*elease` ]; then FOUND="yes" FAMILY="debian" fi - +if [ ! $FOUND = "yes" ]; then + if [ `grep -qi ubuntu /etc/lsb-release` ] || [ `grep -qi ubuntu /etc/os-release` ]; then + echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" >> /etc/apt/sources.list + apt-get -y install dirmngr + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 + apt-get -y update +#confirm PPA location +# apt-get install software-properties-common +# apt-add-repository ppa:ansible/ansible +# apt-get update + apt-get -y install ansible git python-pip python-setuptools python-wheel patch +# apt-get install ansible python-kerberos python-selinux python-winrm python-xmltodict sshpass bzip2 file findutils gzip tar unzip zip python-keyczar python-boto python-dnspython python-pyrax python-sphere + FOUND="yes" + FAMILY="debian" + fi +fi if [ ! $FOUND = "yes" ]; then echo 'WARN: Could not detect distro or distro unsupported' exit 1