mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
better handling of ansible repo on debian family - exit with warning if upstream absent
This commit is contained in:
parent
5ca92d71e5
commit
b05f15a89e
1 changed files with 11 additions and 4 deletions
|
@ -32,10 +32,12 @@ if ! [ $(which ansible-playbook) ]; then
|
|||
FOUND="yes"
|
||||
FAMILY="olpc"
|
||||
elif [ -f /etc/debian_version ] || [ `grep -qi raspbian /etc/*elease` ]; then
|
||||
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \
|
||||
>> /etc/apt/sources.list.d/ansible
|
||||
apt-get -y install dirmngr python-pip python-setuptools python-wheel patch
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
|
||||
if [ ! `grep -qi ansible /etc/apt/sources.list` ] && [ ! -f /etc/apt/sources.list.d/ansible ]; then
|
||||
apt-get -y install dirmngr python-pip python-setuptools python-wheel patch
|
||||
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \
|
||||
>> /etc/apt/sources.list.d/ansible
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
|
||||
fi
|
||||
FOUND="yes"
|
||||
FAMILY="debian"
|
||||
elif [ `grep -qi ubuntu /etc/lsb-release` ] || [ `grep -qi ubuntu /etc/os-release` ]; then
|
||||
|
@ -59,6 +61,10 @@ else
|
|||
echo "Please use pip package manager to update ansible"
|
||||
exit 0
|
||||
fi
|
||||
if [ ! `grep -qi ansible /etc/apt/sources.list ] || [ ! -f /etc/apt/sources.list.d/ansible ]; then
|
||||
echo "Upstream ansible source repo not found, please uninstall ansible and re-run this script"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && \
|
||||
|
@ -68,5 +74,6 @@ if [ ! -f /etc/centos-release ] && [ ! -f /etc/fedora-release ] && \
|
|||
apt-get -y install ansible
|
||||
fi
|
||||
|
||||
# needed?
|
||||
mkdir -p /etc/ansible/
|
||||
echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts
|
||||
|
|
Loading…
Add table
Reference in a new issue