Skip to content

Commit 829974b

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add check and diff options to kolla-ansible" into stable/wallaby
2 parents 0f4b6e4 + 229e3f4 commit 829974b

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
features:
3+
- |
4+
Adds two new arguments to the ``kolla-ansible`` command, ``--check``
5+
and ``--diff``. They are passed through directly to ``ansible-playbook``.

tools/kolla-ansible

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ Options:
139139
--vault-id <@prompt or path> Specify @prompt or password file (Ansible >= 2.4)
140140
--ask-vault-pass Ask for vault password
141141
--vault-password-file <path> Specify password file for vault decrypt
142+
--check, -C Don't make any changes and try to predict some of the changes that may occur instead
143+
--diff, -D Show differences in ansible-playbook changed tasks
142144
--verbose, -v Increase verbosity of ansible-playbook
143145
144146
Environment variables:
@@ -190,6 +192,8 @@ cat <<EOF
190192
--vault-id
191193
--ask-vault-pass
192194
--vault-password-file
195+
--check -C
196+
--diff -D
193197
--verbose -v
194198
prechecks
195199
check
@@ -217,8 +221,8 @@ EOF
217221

218222
check_environment_coherence
219223

220-
SHORT_OPTS="hi:p:t:k:e:v"
221-
LONG_OPTS="help,inventory:,playbook:,skip-tags:,tags:,key:,extra:,verbose,configdir:,passwords:,limit:,forks:,vault-id:,ask-vault-pass,vault-password-file:,yes-i-really-really-mean-it,include-images,include-dev:,full,incremental"
224+
SHORT_OPTS="hi:p:t:k:e:CD:v"
225+
LONG_OPTS="help,inventory:,playbook:,skip-tags:,tags:,key:,extra:,check,diff,verbose,configdir:,passwords:,limit:,forks:,vault-id:,ask-vault-pass,vault-password-file:,yes-i-really-really-mean-it,include-images,include-dev:,full,incremental"
222226

223227
RAW_ARGS="$*"
224228
ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; }
@@ -263,6 +267,16 @@ while [ "$#" -gt 0 ]; do
263267
shift 2
264268
;;
265269

270+
(--check|-C)
271+
EXTRA_OPTS="$EXTRA_OPTS --check"
272+
shift 1
273+
;;
274+
275+
(--diff|-D)
276+
EXTRA_OPTS="$EXTRA_OPTS --diff"
277+
shift 1
278+
;;
279+
266280
(--verbose|-v)
267281
VERBOSITY="$VERBOSITY --verbose"
268282
shift 1

0 commit comments

Comments
 (0)