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
This commit is contained in:
parent
42f6ef4637
commit
c3e91725e2
5
releasenotes/notes/skip-tags-c0a4ac3900f33e7f.yaml
Normal file
5
releasenotes/notes/skip-tags-c0a4ac3900f33e7f.yaml
Normal file
@ -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``.
|
@ -40,6 +40,7 @@ Options:
|
|||||||
--key -k <key_path> Specify path to ansible vault keyfile
|
--key -k <key_path> Specify path to ansible vault keyfile
|
||||||
--help, -h Show this usage information
|
--help, -h Show this usage information
|
||||||
--tags, -t <tags> Only run plays and tasks tagged with these values
|
--tags, -t <tags> Only run plays and tasks tagged with these values
|
||||||
|
--skip-tags <tags> Only run plays and tasks whose tags do not match these values
|
||||||
--extra, -e <ansible variables> Set additional variables as key=value or YAML/JSON passed to ansible-playbook
|
--extra, -e <ansible variables> Set additional variables as key=value or YAML/JSON passed to ansible-playbook
|
||||||
--passwords <passwords_path> Specify path to the passwords file
|
--passwords <passwords_path> Specify path to the passwords file
|
||||||
--limit <host> Specify host to run plays
|
--limit <host> Specify host to run plays
|
||||||
@ -76,6 +77,7 @@ cat <<EOF
|
|||||||
--configdir
|
--configdir
|
||||||
--key -k
|
--key -k
|
||||||
--help -h
|
--help -h
|
||||||
|
--skip-tags
|
||||||
--tags -t
|
--tags -t
|
||||||
--extra -e
|
--extra -e
|
||||||
--passwords
|
--passwords
|
||||||
@ -103,7 +105,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
SHORT_OPTS="hi:p:t:k:e:v"
|
SHORT_OPTS="hi:p:t:k:e:v"
|
||||||
LONG_OPTS="help,inventory:,playbook:,tags:,key:,extra:,verbose,configdir:,passwords:,limit:,vault-id:,ask-vault-pass,vault-password-file:,yes-i-really-really-mean-it,include-images,include-dev"
|
LONG_OPTS="help,inventory:,playbook:,skip-tags:,tags:,key:,extra:,verbose,configdir:,passwords:,limit:,vault-id:,ask-vault-pass,vault-password-file:,yes-i-really-really-mean-it,include-images,include-dev"
|
||||||
ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; }
|
ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; }
|
||||||
|
|
||||||
eval set -- "$ARGS"
|
eval set -- "$ARGS"
|
||||||
@ -136,6 +138,11 @@ while [ "$#" -gt 0 ]; do
|
|||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(--skip-tags)
|
||||||
|
EXTRA_OPTS="$EXTRA_OPTS --skip-tags $2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
|
||||||
(--tags|-t)
|
(--tags|-t)
|
||||||
EXTRA_OPTS="$EXTRA_OPTS --tags $2"
|
EXTRA_OPTS="$EXTRA_OPTS --tags $2"
|
||||||
shift 2
|
shift 2
|
||||||
|
Loading…
Reference in New Issue
Block a user