-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathrequirements.sh
executable file
·160 lines (109 loc) · 2.68 KB
/
requirements.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
# TODO: Make it for Debian, Suse & Mac
if [ $# -ne 1 ]
then
echo "ERROR: missing machine_type=[rhel|debian|suse|mac] argument"
exit 1
fi
machine_type=$1
if [ -z $machine_type ]
then
machine_type="rhel"
fi
echo "Will run requirements for $machine_type"
### Requirements to run this script #####
echo "Set script runnable"
chmod +x *.sh
if [ "$machine_type" == "rhel" ]
then
echo "Install wget"
yum -y install wget
echo "Install Git"
yum -y install git
echo "Install Unzip"
yum -y install unzip
echo "Install network packages"
yum -y install dnsutils
yum -y install bind-utils
echo "Install Python 3"
yum -y install python3
echo "Install ansible"
yum -y install epel-release
yum -y install ansible
# TODO
echo "Install Terraform"
# TODO
echo "Install AWS CLI"
# TODO
echo "Install pcregrep"
elif [ "$machine_type" == "debian" ]
then
echo "Install wget"
apt -y install wget
echo "Install Git"
apt -y install wget
echo "Install Unzip"
apt -y install unzip
echo "Install network packages"
apt -y install dnsutils
apt -y install bind9-utils
echo "Install Python 3"
apt -y install python3
echo "Install ansible"
apt -y install ansible
# TODO
echo "Install Terraform"
# TODO
echo "Install AWS CLI"
# TODO
echo "Install pcregrep"
elif [ "$machine_type" == "suse" ]
then
echo "Install wget"
zypper -n install wget
echo "Install Git"
zypper -n install git
echo "Install Unzip"
zypper -n install unzip
echo "Install network packages"
zypper -n install bind-utils
echo "Install Python 3"
zypper -n install python3
echo "Install ansible"
zypper -n install ansible
# TODO
echo "Install Terraform"
# TODO
echo "Install AWS CLI"
# TODO
echo "Install pcregrep"
elif [ "$machine_type" == "mac" ]
then
echo "TODO: Install wget"
echo "TODO: Install Git"
echo "TODO: Install Unzip"
echo "TODO: Install network packages"
echo "TODO: Install Python 3"
echo "TODO:Install ansible"
# TODO
echo "Install Terraform"
# TODO
echo "Install AWS CLI"
# TODO
echo "Install pcregrep"
fi
if [ ! -d "~/.ssh/" ]
then
echo "Creates .ssh directory"
mkdir -p ~/.ssh/
fi
if [ ! -f "~/.ssh/id_rsa" ]
then
echo "Generates a local key"
ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
fi
echo "Install ansible required collections"
ansible-galaxy collection install community.general
ansible-galaxy collection install freeipa.ansible_freeipa
ansible-galaxy collection install community.crypto
ansible-galaxy collection install ansible.posix