diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-08-31 15:25:07 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-08-31 15:25:07 +0000 |
| commit | 909883a6d4cc5395af897e37c9c5897450dc02e2 (patch) | |
| tree | 362983dfc05b64bbda7ca7375c49ec6d01840cf7 | |
| parent | 7168f3c4306d5095fc0092972f734d10392a91a9 (diff) | |
| parent | 96bf1cfee4fe4d9ebe6d6bfe7b7ce93a12d6a5c3 (diff) | |
| download | kolla-909883a6d4cc5395af897e37c9c5897450dc02e2.tar.gz kolla-909883a6d4cc5395af897e37c9c5897450dc02e2.zip | |
Merge "Add warning to kolla-ansible destroy action"
| -rwxr-xr-x | tools/kolla-ansible | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/kolla-ansible b/tools/kolla-ansible index a37cbbf7b..5772e5f1a 100755 --- a/tools/kolla-ansible +++ b/tools/kolla-ansible @@ -56,7 +56,7 @@ EOF SHORT_OPTS="hi:p:t:k:e:v" -LONG_OPTS="help,inventory:,playbook:,tags:,key:,extra:,verbose,configdir:,passwords:" +LONG_OPTS="help,inventory:,playbook:,tags:,key:,extra:,verbose,configdir:,passwords:,yes-i-really-really-mean-it" ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; } eval set -- "$ARGS" @@ -69,6 +69,7 @@ VERBOSITY= EXTRA_OPTS= CONFIG_DIR="/etc/kolla" PASSWORDS_FILE="${CONFIG_DIR}/passwords.yml" +DANGER_CONFIRM= while [ "$#" -gt 0 ]; do case "$1" in @@ -98,6 +99,11 @@ while [ "$#" -gt 0 ]; do shift 2 ;; + (--yes-i-really-really-mean-it) + DANGER_CONFIRM="$1" + shift 1 + ;; + (--key|-k) VAULT_PASS_FILE="$2" EXTRA_OPTS="$EXTRA_OPTS --vault-password-file=$VAULT_PASS_FILE" @@ -144,6 +150,15 @@ case "$1" in (destroy) ACTION="Destroy Kolla containers, volumes and host configuration" PLAYBOOK="${BASEDIR}/ansible/destroy.yml" + if [[ "${DANGER_CONFIRM}" != "--yes-i-really-really-mean-it" ]]; then + cat << EOF +WARNING: + This will PERMANENTLY DESTROY all deployed kolla containers, volumes and host configuration. + There is no way to recover from this action. To confirm, please add the following option: + --yes-i-really-really-mean-it +EOF + exit 1 + fi ;; (bootstrap-servers) ACTION="Deploying Playbooks" |
