From c3e91725e25b4e7483bc99edc3f517eef798eb0a Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 16 Oct 2017 17:39:45 +0100 Subject: [PATCH] Add support for --skip-tags argument This allows for skipping tasks which match the provided tags, using the ansible-playbook argument of the same name. This can be useful in combination with --tags, to skip reconfiguration of the common tasks: kolla-ansible reconfigure --tags nova --skip-tags common Change-Id: I766552f7ae4099da3d174759f4a609ffe8b4d89f --- releasenotes/notes/skip-tags-c0a4ac3900f33e7f.yaml | 5 +++++ tools/kolla-ansible | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/skip-tags-c0a4ac3900f33e7f.yaml diff --git a/releasenotes/notes/skip-tags-c0a4ac3900f33e7f.yaml b/releasenotes/notes/skip-tags-c0a4ac3900f33e7f.yaml new file mode 100644 index 0000000000..f1d112f62d --- /dev/null +++ b/releasenotes/notes/skip-tags-c0a4ac3900f33e7f.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds a new argument to the ``kolla-ansible`` command, ``--skip-tags TAGS``. + This argument is passed through directly to ``ansible-playbook``. diff --git a/tools/kolla-ansible b/tools/kolla-ansible index 8c2bd3cd70..72d8e86c8b 100755 --- a/tools/kolla-ansible +++ b/tools/kolla-ansible @@ -40,6 +40,7 @@ Options: --key -k Specify path to ansible vault keyfile --help, -h Show this usage information --tags, -t Only run plays and tasks tagged with these values + --skip-tags Only run plays and tasks whose tags do not match these values --extra, -e Set additional variables as key=value or YAML/JSON passed to ansible-playbook --passwords Specify path to the passwords file --limit Specify host to run plays @@ -76,6 +77,7 @@ cat <&2; exit 2; } eval set -- "$ARGS" @@ -136,6 +138,11 @@ while [ "$#" -gt 0 ]; do shift 2 ;; + (--skip-tags) + EXTRA_OPTS="$EXTRA_OPTS --skip-tags $2" + shift 2 + ;; + (--tags|-t) EXTRA_OPTS="$EXTRA_OPTS --tags $2" shift 2