-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrdo-demo-packstack
executable file
·52 lines (38 loc) · 1.33 KB
/
rdo-demo-packstack
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
#!/bin/bash
srcdir=$(readlink -m $(dirname $0))
source $srcdir/common
print_help() {
echo "$0 [os type] [num hosts] [release]"
echo
echo "This script kicks off a Packstack run across the specificed"
echo "hosts in a virtual datacenter"
echo
echo "Valid os types are: $IMG_TYPES"
echo "Valid OpenStack releases are: $RDO_RELEASES"
exit 0
}
TYPE=$1
NUM=$2
REL=$3
checktype $TYPE
test -z "$NUM" && NUM=1
test -z "$REL" && REL=juno
mgmt=admin@${TYPE}1
sub=$(getsub $TYPE)
privsub=$(( $sub - 50 ))
ans="packstack-rdo-${REL}.ans"
foreach_host $TYPE $NUM "$VIRSH start"
sshwait_hosts $TYPE $NUM
foreach_hostssh $TYPE $NUM "cd rdo-demo-helper && git pull && root-ssh-setup"
$ssh $mgmt "rpm -q rdo-release || sudo yum install -y $RDO_URL/openstack-$REL/rdo-release-$REL.rpm"
$ssh $mgmt "rpm -q openstack-packstack || sudo yum install openstack-packstack -y"
for i in `seq 1 $NUM`; do
ip="$(( $i + 100))"
$ssh admin@$TYPE$i "gen-static-ifcfg eth1 192.168.$privsub.$ip"
done
foreach_hostssh $TYPE $NUM "sudo ifup eth1"
$ssh $mgmt "sudo yum-config-manager --enable epel > /dev/null"
$ssh $mgmt "gen-answer-file $TYPE $NUM rdo-demo-helper/$ans"
$ssh $mgmt "packstack --answer-file=packstack.ans"
$ssh $mgmt "sudo cp -vf /root/keystonerc_demo ~ && sudo chown admin keystonerc_demo"
$ssh $mgmt "rdo-${REL}-workarounds"