2014-09-03 21:41:02 +08:00
|
|
|
#!/bin/bash
|
2015-06-09 22:06:54 +08:00
|
|
|
#
|
|
|
|
# THIS SCRIPT INSTALLS ANSIBLE
|
2016-04-04 21:09:44 +08:00
|
|
|
set -e
|
2014-09-03 21:41:02 +08:00
|
|
|
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
|
|
echo "You are NOT running this script as root."
|
|
|
|
echo "You should."
|
|
|
|
echo "Really."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -x $(which lsb_release 2>/dev/null) ]]; then
|
|
|
|
os_VENDOR=$(lsb_release -i -s)
|
2014-12-04 19:04:20 +08:00
|
|
|
os_VERSION=$(lsb_release -c -s)
|
2014-09-03 21:41:02 +08:00
|
|
|
if [[ "Debian" =~ $os_VENDOR ]]; then
|
|
|
|
apt-get update
|
2016-04-04 21:09:44 +08:00
|
|
|
apt-get install -y python-pip python-dev git build-essential
|
2014-09-03 21:41:02 +08:00
|
|
|
pip install PyYAML jinja2 paramiko
|
|
|
|
git clone https://github.com/ansible/ansible.git
|
|
|
|
cd ansible
|
|
|
|
make install
|
|
|
|
mkdir /etc/ansible
|
|
|
|
elif [[ "Ubuntu" =~ $os_VENDOR ]]; then
|
2016-04-04 21:09:44 +08:00
|
|
|
add-apt-repository -y ppa:ansible/ansible
|
2016-01-11 22:07:19 +08:00
|
|
|
apt-get update
|
|
|
|
apt-get install -y ansible
|
2016-01-12 00:05:53 +08:00
|
|
|
elif [[ "RedHatEnterpriseServer" =~ $os_VENDOR ]]; then
|
2016-01-11 22:07:19 +08:00
|
|
|
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
|
|
|
yum install -y ansible
|
2016-01-12 00:05:53 +08:00
|
|
|
else
|
|
|
|
echo "Unsupported platform ${os_VENDOR}: ${os_VERSION}"
|
|
|
|
echo "Please send a pull-request or open an issue"
|
|
|
|
echo "on https://github.com/ceph/ceph-ansible/"
|
|
|
|
exit 1
|
2014-09-30 20:12:48 +08:00
|
|
|
fi
|
2014-09-03 21:41:02 +08:00
|
|
|
elif [[ -r /etc/redhat-release ]]; then
|
2016-01-11 22:07:19 +08:00
|
|
|
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
2014-09-03 21:41:02 +08:00
|
|
|
yum install -y ansible
|
|
|
|
fi
|