-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
34 lines (23 loc) · 776 Bytes
/
install.sh
File metadata and controls
34 lines (23 loc) · 776 Bytes
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
#!/bin/bash
originalUser=$(who am i | awk '{print $1}')
baseUrl="https://raw.githubusercontent.com/shakahl/ansible-runner-docker/master"
installPath="/usr/local/bin/ansible-runner"
configDir="$HOME/.ansible"
echo "Ansible Runner Docker"
if [ ! -d $configDir ]; then
mkdir -p $configDir
fi
if [ ! -f "$configDir/ansible.cfg" ]; then
curl -o "$configDir/ansible.cfg" "$baseUrl/docker/etc/ansible/ansible.cfg"
fi
if [ ! -f "$configDir/hosts" ]; then
curl -o "$configDir/hosts" "$baseUrl/docker/etc/ansible/hosts"
fi
chown -R $originalUser $configDir
chmod -R 0770 $configDir/*
curl -o "$installPath" "$baseUrl/ansible-runner.sh"
chmod 0775 $installPath
docker login
docker pull shakahl/ansible-runner-docker
echo "Successfully installed: $installPath"
exit 0