-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
72 lines (59 loc) · 1.53 KB
/
install.sh
File metadata and controls
72 lines (59 loc) · 1.53 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
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
## Script to deploy Ansible on Azure
## Centos 7.5
## Tested on Azure MSFT
## Developer: Manuel Alejandro Peña Sánchez
## Ansible on Azure
source ./conf/setup.sh
source ./include/functions.sh
ANSIBLE="true"
LPIP=$INTERNET
if [ "$SUBSCRIPTIONID" != "" ]; then
az account set -s $SUBSCRIPTIONID
fi
>~/bAnsi.log
case $1 in
deploy)
CHECK=$(sshpass -V)
if [ "$?" -ne 0 ]; then
if [ -f /etc/debian[-,_]version ]; then
OS="debian"
fi
if [ -f /etc/centos[-,_]version ]; then
OS="centos"
fi
case $OS in
debian)
apt-get -y install sshpass
;;
centos)
yum -y install sshpass
;;
*)
echo "Not SSHPass Installed"
exit
;;
esac
fi
if [ "$ANSIBLE" == "true" ]; then
source ./main/ansible.sh
else
echo "Ambiente Ansible en $ANSIBLE"
#fi >> ~/bAnsi.log 2>&1
fi
echo "Ansible Access to $AZIPVMB with $AZVMUser through SSH with $AZVMPass"
;;
remove)
if [ "$ANSIBLE" == "true" ]; then
f_title "Remove Ansible"
az group delete -n $(echo $AZCSUFF | awk '{ print toupper($0) }')RGANSI -y
else
echo "Ambiente Ansible en $ANSIBLE"
fi
az group delete -n $(echo $AZCSUFF | awk '{ print toupper($0) }')RGVNET -y
;;
*)
echo "Uso: $0 {deploy AZPREFIX AZZONE AZUSER AZPASS | remove AZPREFIX}"
exit 2
;;
esac