-
Notifications
You must be signed in to change notification settings - Fork 5
/
provision-all.sh
executable file
·62 lines (46 loc) · 1.7 KB
/
provision-all.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
#!/bin/bash -x
if [ -n "$1" ]; then
identity="-i $1"
fi
mkdir -p logs
hosts=()
while IFS=, read name ip dns password
do
hosts+=("$dns")
bin/issh $identity -tt cloud-user@$dns sudo passwd demo --stdin <<<$password &>logs/$dns-1-passwd
[ $? -ne 0 ] && echo "Failed to set password on $dns (host not finished booting yet?), bailing" && exit 1
scp $identity -S bin/issh target/* cloud-user@$dns: &>logs/$dns-2-scp
done <creds.csv
for dns in "${hosts[@]}"
do
bin/issh $identity -tt cloud-user@$dns sudo ./fixup.sh &>logs/$dns-2a-fixup &
done
echo "*** WAITING FOR FIXUP PROCESSES ***"
wait
for dns in "${hosts[@]}"
do
bin/issh $identity -tt cloud-user@$dns sudo ./warm-ebs.sh &>logs/$dns-3-ebs &
done
echo "*** WAITING FOR EBS WARMUP PROCESSES ***"
wait
for dns in "${hosts[@]}"
do
bin/issh $identity -tt cloud-user@$dns sudo 'bash -c "cd /home/cloud-user; ./openshift-aws-reip.sh"' </dev/null &>logs/$dns-4-reip &
done
echo "*** WAITING FOR REIP PROCESSES ***"
wait
for dns in "${hosts[@]}"
do
bin/issh $identity -tt cloud-user@$dns sudo 'sed -i -e "/^PermitEmptyPasswords yes/ d" /etc/ssh/sshd_config' &>logs/$dns-5-sshd
bin/issh $identity -tt cloud-user@$dns sudo 'sed -i -e "/^PasswordAuthentication no/ d" /etc/ssh/sshd_config' >>logs/$dns-5-sshd 2>&1
bin/issh $identity -tt cloud-user@$dns sudo 'systemctl restart sshd.service' >>logs/$dns-5-sshd 2>&1
bin/issh $identity -tt cloud-user@$dns sudo 'bash -c "cd /home/cloud-user; ./create-novnc.sh"' &>logs/$dns-6-novnc &
done
echo "*** WAITING FOR NOVNC PROCESSES ***"
wait
for dns in "${hosts[@]}"
do
bin/issh $identity -tt cloud-user@$dns sudo ./warm-openshift.sh &>logs/$dns-7-warmup &
done
echo "*** WAITING FOR OSE WARMUP PROCESSES ***"
wait