forked from skdhruv/apuppet-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·68 lines (58 loc) · 1.8 KB
/
install.sh
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
cleanup() {
return_value=$?
if [[ ${return_value} == "0" ]]; then
echo "INSTALL SCRIPT COMPLETED"
else
echo "INSTALL SCRIPT ERROR: ${return_value}"
fi
exit $return_value
}
trap "cleanup" EXIT
ansible_install_newstyle() {
sudo apt-get -y update
sudo apt-get install -y ansible=2.9.*
}
ansible_install_oldschool() {
sudo apt-get -y update
sudo apt install -y software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt-get install -y ansible=2.9.*
}
cd "$(dirname "$0")"
distro_name=$(lsb_release -i | cut -f2)
distro_version=$(lsb_release -r | cut -f2)
echo "Installing Ansible software to deploy aPuppet .."
echo "Detected distro name=\"${distro_name}\" and version=\"${distro_version}\""
case ${distro_name} in
"Ubuntu")
case ${distro_version} in
"16.04" | "18.04")
echo "OK, start installing on old LTS ${distro_name} ${distro_version} .."
ansible_install_oldschool
;;
"20.04")
echo "OK, start installing on actual LTS ${distro_name} ${distro_version} .."
ansible_install_newstyle
;;
*)
echo "Could not install aPuppet on your Ubuntu version: $distro_version. We support only LTS Ubuntu versions: 16.04.*, 18.04.*, 20.04.*"
exit 1
;;
esac
;;
*)
echo "Only Ubuntu is available. If you need to install on another distro please contact aPuppet maintainer."
exit 1
;;
esac
echo "Start deploy aPuppet .."
sudo ansible-playbook deploy/install.yaml
echo "Start aPuppet .."
sudo ansible-playbook deploy/start.yaml
#
#janus_api_secret=$(cat ./deploy/dist/credentials/janus_api_secret)
#
#echo "To control your mobile devices remotely, install the aPuppet Android agent and use the following server URL and secret:"
#echo "URL: https://srv.apuppet.org/web-admin/"
#echo "API Secret: ${janus_api_secret}"