-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_ansible.sh
More file actions
44 lines (40 loc) · 1.18 KB
/
install_ansible.sh
File metadata and controls
44 lines (40 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
sh_c='sh -c'
if [ "$(id --name --user)" != 'root' ]
then
if command -v sudo
then
sh_c='sudo -E sh -c'
elif command -v su
then
sh_c='su --command'
else
exit 1
fi
fi
version="==$1"
command -v yum &&
$sh_c 'sleep 3
yum --assumeyes install epel-release &&
yum --assumeyes install PyYAML \
python-paramiko \
python-jinja2 \
python-setuptools \
python-httplib2 \
python-keyczar \
python-pip \
sshpass \
git'
command -v apt-get &&
$sh_c 'sleep 3
apt-get update &&
apt-get --assume-yes install python-yaml \
python-paramiko \
python-jinja2 \
python-setuptools \
python-httplib2 \
python-keyczar \
python-pip \
sshpass \
git'
$sh_c "pip install ansible${1:+$version}"