diff --git a/tools/kolla-ansible b/tools/kolla-ansible index 941c49a465..884be19e5c 100755 --- a/tools/kolla-ansible +++ b/tools/kolla-ansible @@ -43,7 +43,7 @@ Commands: mariadb_recovery Recover a completely stopped mariadb cluster bootstrap-servers bootstrap servers with kolla deploy dependencies destroy Destroy Kolla containers, volumes and host configuration - ('-e destroy_include_images=yes' to also destroy Kolla images) + (--include-images to also destroy Kolla images) deploy Deploy and start all kolla containers deploy-bifrost Deploy and start bifrost container deploy-servers Enroll and deploy servers with bifrost @@ -58,7 +58,7 @@ EOF SHORT_OPTS="hi:p:t:k:e:v" -LONG_OPTS="help,inventory:,playbook:,tags:,key:,extra:,verbose,configdir:,passwords:,yes-i-really-really-mean-it" +LONG_OPTS="help,inventory:,playbook:,tags:,key:,extra:,verbose,configdir:,passwords:,yes-i-really-really-mean-it,include-images" ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; } eval set -- "$ARGS" @@ -72,6 +72,7 @@ EXTRA_OPTS= CONFIG_DIR="/etc/kolla" PASSWORDS_FILE="${CONFIG_DIR}/passwords.yml" DANGER_CONFIRM= +INCLUDE_IMAGES= while [ "$#" -gt 0 ]; do case "$1" in @@ -106,6 +107,11 @@ while [ "$#" -gt 0 ]; do shift 1 ;; + (--include-images) + INCLUDE_IMAGES="$1" + shift 1 + ;; + (--key|-k) VAULT_PASS_FILE="$2" EXTRA_OPTS="$EXTRA_OPTS --vault-password-file=$VAULT_PASS_FILE" @@ -152,6 +158,9 @@ case "$1" in (destroy) ACTION="Destroy Kolla containers, volumes and host configuration" PLAYBOOK="${BASEDIR}/ansible/destroy.yml" + if [[ "${INCLUDE_IMAGES}" == "--include-images" ]]; then + EXTRA_OPTS="$EXTRA_OPTS -e destroy_include_images=yes" + fi if [[ "${DANGER_CONFIRM}" != "--yes-i-really-really-mean-it" ]]; then cat << EOF WARNING: