mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
find unbutu as a last resort to quite looking for /etc/lsb-release - exit if version is 2.4.0.0
This commit is contained in:
parent
1b2d4e1c7d
commit
54b4a3c2b0
1 changed files with 23 additions and 20 deletions
|
@ -9,16 +9,19 @@ if [ $(which ansible-playbook) ]; then
|
||||||
if [ $VER = "2.2.0.0" ]; then
|
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
|
||||||
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
|
||||||
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 " "`
|
||||||
# echo "Ansible $VER installed exiting..."
|
|
||||||
# exit 0
|
|
||||||
#fi
|
|
||||||
echo "Installing --- Please Wait"
|
echo "Installing --- Please Wait"
|
||||||
if [ -f /etc/fedora-release ]; then
|
if [ -f /etc/fedora-release ]; then
|
||||||
VER=`grep VERSION_ID /etc/*elease | cut -d= -f2`
|
VER=`grep VERSION_ID /etc/*elease | cut -d= -f2`
|
||||||
|
@ -51,7 +54,6 @@ if [ -f /etc/olpc-release ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /etc/debian_version ]; then
|
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
|
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" >> /etc/apt/sources.list
|
||||||
apt-get -y install dirmngr
|
apt-get -y install dirmngr
|
||||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
|
||||||
|
@ -61,20 +63,6 @@ if [ -f /etc/debian_version ]; then
|
||||||
FOUND="yes"
|
FOUND="yes"
|
||||||
FAMILY="debian"
|
FAMILY="debian"
|
||||||
fi
|
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
|
# Has 2.2.1
|
||||||
if [ `grep -qi raspbian /etc/*elease` ]; then
|
if [ `grep -qi raspbian /etc/*elease` ]; then
|
||||||
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" >> /etc/apt/sources.list
|
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"
|
FOUND="yes"
|
||||||
FAMILY="debian"
|
FAMILY="debian"
|
||||||
fi
|
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
|
if [ ! $FOUND = "yes" ]; then
|
||||||
echo 'WARN: Could not detect distro or distro unsupported'
|
echo 'WARN: Could not detect distro or distro unsupported'
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue