From 0e720b382b7914ff3cce715f2608bd92cad41a2d Mon Sep 17 00:00:00 2001 From: Michal Arbet Date: Thu, 19 Aug 2021 14:57:31 +0200 Subject: Add check and diff options to kolla-ansible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch is adding --check and --diff options to kolla-ansible, which cause that kolla-ansible run will be more verbose and able to run in semi dry-run mode. The --diff option for kolla-ansible can be used alone or with --check. When you run in diff mode, any module that supports diff mode reports the changes made or, if used with --check, the changes that would have been made. Diff mode is most common in modules that manipulate files (for example, the template module) but other modules might also show ‘before and after’ information (for example, the user module). For more information check [1]. [1] https://docs.ansible.com/ansible/latest/user_guide/playbooks_checkmode.html#using-diff-mode Change-Id: Ifb82ea99e5af82540e938eab9e2a442b2820d7df --- tools/kolla-ansible | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/kolla-ansible b/tools/kolla-ansible index a6d222b7a..0b4a0897f 100755 --- a/tools/kolla-ansible +++ b/tools/kolla-ansible @@ -140,6 +140,8 @@ Can be specified multiple times to pass multiple inventories. --vault-id <@prompt or path> Specify @prompt or password file (Ansible >= 2.4) --ask-vault-pass Ask for vault password --vault-password-file Specify password file for vault decrypt + --check, -C Don't make any changes and try to predict some of the changes that may occur instead + --diff, -D Show differences in ansible-playbook changed tasks --verbose, -v Increase verbosity of ansible-playbook Environment variables: @@ -191,6 +193,8 @@ cat <&2; exit 2; } @@ -265,6 +269,16 @@ while [ "$#" -gt 0 ]; do shift 2 ;; + (--check|-C) + EXTRA_OPTS="$EXTRA_OPTS --check" + shift 1 + ;; + + (--diff|-D) + EXTRA_OPTS="$EXTRA_OPTS --diff" + shift 1 + ;; + (--verbose|-v) VERBOSITY="$VERBOSITY --verbose" shift 1 -- cgit v1.2.3