-
Notifications
You must be signed in to change notification settings - Fork 1
/
kayobe-undeploy.sh
executable file
·50 lines (38 loc) · 1.16 KB
/
kayobe-undeploy.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
#!/bin/bash -ex
# Undeploy a control plane using OpenStack kayobe.
set -o pipefail
KC_PATH=${KC_PATH:-kayobe-config}
KAYOBE_PATH=${KAYOBE_PATH:-kayobe}
function init_kayobe {
if [[ ! -n ${KAYOBE_VAULT_PASSWORD} ]] ; then
echo "Ansible Vault password environment variable $$KAYOBE_VAULT_PASSWORD not set - prompting"
read -s -p "Enter Ansible Vault password:" KAYOBE_VAULT_PASSWORD
export KAYOBE_VAULT_PASSWORD
fi
if [[ ! -e ${KAYOBE_PATH} ]] ; then
echo "Kayobe checkout does not exist at ${KAYOBE_PATH}"
exit 1
fi
if [[ ! -e ${KC_PATH} ]] ; then
echo "Kayobe config checkout does not exist at ${KC_PATH}"
exit 1
fi
echo "Sourcing kayobe environment file"
source ${KC_PATH}/kayobe-env
echo "Activating the kayobe virtualenv"
cd ${KAYOBE_PATH}
source kayobe-venv/bin/activate
if ! which kayobe > /dev/null 2>&1 ; then
echo "Kayobe CLI not found on path"
exit 1
fi
}
function undeploy_control_plane {
echo "Deprovisioning kayobe overcloud hosts"
time kayobe overcloud deprovision
}
function main {
init_kayobe
undeploy_control_plane
}
main