-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate_download_yamls.sh
53 lines (42 loc) · 1.13 KB
/
create_download_yamls.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
#!/bin/bash
# export PYTHONPATH="./pylibs:./05_setup/environments"
# export FUEL_MASTER_NODE=10.108.0.2
set -e
envs="
simple_nova_flat_cei
simple_neut_gre_ceph_sah_mur_cei
ha_neut_vlan_cei
ha_neut_vlan_sah_mur_cei
"
mkdir -p yaml
function rename_yaml () {
in=$1
name=$2
for file in ${in}*yaml ; do
if [ -f "$file" ] ; then
role=$(awk '/^role:/{print $2}' $file) && mv $file ${name}.${role}.yaml || true
fi
done
}
for env in $envs ; do
# cleanup
ssh root@$FUEL_MASTER_NODE rm -rf /root/deployment_*/
# create env
python manage_env.py $FUEL_MASTER_NODE $env create /dev/null
# download yaml
sleep 1
ssh root@$FUEL_MASTER_NODE 'fuel deployment --default --env $(fuel node | grep controller | awk "{print \$8}")'
sleep 1
scp root@$FUEL_MASTER_NODE:~/deployment_*/*yaml yaml/
# rename yamls
pushd yaml
rename_yaml cinder ${env}
rename_yaml compute ${env}
rename_yaml controller ${env}
rename_yaml ceph-osd ${env}
rename_yaml primary-mongo ${env}
rename_yaml primary-controller ${env}
# rename_yaml ${env}
popd
python manage_env.py $FUEL_MASTER_NODE $env remove /dev/null
done