diff --git a/tools/kolla-ansible b/tools/kolla-ansible index 021af79ac9..73d7316f57 100755 --- a/tools/kolla-ansible +++ b/tools/kolla-ansible @@ -30,6 +30,7 @@ Usage: $0 COMMAND [options] Options: --inventory, -i Specify path to ansible inventory file --playbook, -p Specify path to ansible playbook file + --keyfile, -k Specify path to ansible vault keyfile --help, -h Show this usage information --tags, -t Only run plays and tasks tagged with these values @@ -41,9 +42,11 @@ Commands: EOF } -SHORT_OPTS="hi:p:t:" -LONG_OPTS="help,inventory:,playbook:,tags:" + +SHORT_OPTS="hi:p:t:k:" +LONG_OPTS="help,inventory:,playbook:,tags:,keyfile:" ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; } + eval set -- "$ARGS" find_base_dir @@ -69,6 +72,12 @@ while [ "$#" -gt 0 ]; do shift 2 ;; + (--keyfile|-k) + VAULT_PASS_FILE="$2" + EXTRA_OPTS="$EXTRA_OPTS --vault-password-file=$VAULT_PASS_FILE" + shift 2 + ;; + (--help|-h) usage shift