forked from mcgonagle/ansible_f5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_ansible.sh
executable file
·72 lines (71 loc) · 3.43 KB
/
run_ansible.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
69
70
71
72
#!/bin/bash
while test $# -gt 0; do
case "$1" in
-h|--help)
echo " "
echo "options:"
echo "-h, --help show brief help"
echo "-a, --all run the site playbook"
echo "-n, --onboarding run the onboarding playbook"
echo "-o, --operation run the operation playbook"
echo "-t, --teardown run the teardown playbook"
echo "--today run the today playbook"
echo "-ltm1 run thr operationLTM1 playbook"
exit 0
;;
-n)
shift
ansible-playbook playbooks/onboarding.yml --ask-vault-pass -e @password.yml -vvv
shift
;;
--onboarding*)
ansible-playbook playbooks/onboarding.yml --ask-vault-pass -e @password.yml -vvv
shift
;;
-o)
ansible-playbook playbooks/operations.yml --ask-vault-pass -e @password.yml -e state="present" -vvv
shift
;;
--operation*)
ansible-playbook playbooks/operations.yml --ask-vault-pass -e @password.yml -e state="present" -vvv
shift
;;
-t)
ansible-playbook playbooks/operations.yml --ask-vault-pass -e @password.yml -e state="absent" -vvv
shift
;;
--teardown*)
ansible-playbook playbooks/operations.yml --ask-vault-pass -e @password.yml -e state="absent" -vvv
shift
;;
--today*)
ansible-playbook playbooks/today.yml --ask-vault-pass -e @password.yml -vvv
shift
;;
-d)
ansible-galaxy init roles/$(date +%m%d%Y) && cd roles; ln -sfn $(date +%m%d%Y) today;cd ..
shift
;;
--date*)
ansible-galaxy init roles/$(date +%m%d%Y) && cd roles; ln -sfn $(date +%m%d%Y) today;cd ..
shift
;;
-a)
ansible-playbook playbooks/onboarding.yml --ask-vault-pass -e @password.yml -vvv
ansible-playbook playbooks/operations.yml --ask-vault-pass -e @password.yml -e state="present" -vvv
shift
;;
--all*)
ansible-playbook playbooks/onboarding.yml --ask-vault-pass -e @password.yml -vvv
ansible-playbook playbooks/operations.yml --ask-vault-pass -e @password.yml -e state="present" -vvv
shift
;;
-ltm1)
ansible-playbook playbooks/operationsLTM1.yml --ask-vault-pass -e @password.yml -e state="present" -vvv
shift
;;
*)
break
;;
esac
done