-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin
executable file
·37 lines (33 loc) · 1.01 KB
/
admin
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
#!/bin/bash
#
# Continuous integration script that Jenkins (or whatever) calls which:
# Deploys to dev, staging or production as appropriate
set -u # Variables must be explicit
set -e # If any command fails, fail the whole thing
set -o pipefail
cd ansible
source utilities/init.sh
PS3='What do you want to do? '
options=("View Running Hosts" "Add Domain" "Get Name Server" "Quit")
select opt in "${options[@]}"
do
case $opt in
"View Running Hosts")
ansible-playbook list_running_hosts.yaml -vvv
;;
"Add Domain")
echo -n "Enter your new domain and press [ENTER]: "
read domain
ansible-playbook add_domain.yaml -e domain=$domain -vvv
;;
"Get Name Server")
echo -n "Enter requested domain and press [ENTER]: "
read domain
ansible-playbook get_nameserver.yaml -e domain=$domain -vvv
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done