-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·63 lines (58 loc) · 2.04 KB
/
deploy.sh
File metadata and controls
executable file
·63 lines (58 loc) · 2.04 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
#!/usr/bin/env bash
HEAT=1
DOWN=1
CONF=1
STACK=overcloud
source ~/stackrc
if [[ ! -d ~/templates ]]; then
ln -s /usr/share/openstack-tripleo-heat-templates templates
fi
if [[ $HEAT -eq 1 ]]; then
time openstack overcloud deploy \
--templates ~/templates/ \
--stack $STACK
--libvirt-type qemu \
-e ~/cloud-names.yaml \
-e ~/templates/environments/docker.yaml \
-e ~/templates/environments/docker-ha.yaml \
-e ~/docker_registry.yaml \
-e ~/templates/environments/network-isolation.yaml \
-e ~/templates/environments/net-single-nic-with-vlans.yaml \
-e ~/network-environment.yaml \
-e ~/templates/environments/low-memory-usage.yaml \
-e ~/templates/environments/disable-telemetry.yaml \
-e ~/templates/environments/ceph-ansible/ceph-ansible.yaml \
-e ~/overrides.yaml \
--no-config-download
# remove --no-config-download to make DOWN and CONF unnecessary
fi
# -------------------------------------------------------
if [[ $DOWN -eq 1 ]]; then
if [[ $(openstack stack list | grep $STACK | wc -l) -eq 0 ]]; then
echo "No $STACK heat stack. Exiting"
exit 1
fi
tripleo-config-download --stack-name $STACK
if [[ ! -d tripleo-config-download ]]; then
echo "tripleo-config-download cmd didn't create tripleo-config-download dir"
else
pushd tripleo-config-download
tripleo-ansible-inventory --static-yaml-inventory inventory.yaml --stack $STACK
ansible --ssh-extra-args "-o StrictHostKeyChecking=no" -i inventory.yaml all -m ping
popd
echo "pushd tripleo-config-download"
echo 'ansible -i inventory.yaml all -m shell -b -a "hostname"'
fi
fi
# -------------------------------------------------------
if [[ $CONF -eq 1 ]]; then
if [[ ! -e tripleo-config-download/deploy_steps_playbook.yaml ]]; then
MOST_RECENT_DIR=$(ls -trF tripleo-config-download | grep / | tail -1)
fi
time ansible-playbook \
-v \
--ssh-extra-args "-o StrictHostKeyChecking=no" --timeout 240 \
--become \
-i tripleo-config-download/inventory.yaml \
tripleo-config-download/$MOST_RECENT_DIR/deploy_steps_playbook.yaml
fi