add ability to set default tags in config

This commit is contained in:
Brian Coca 2017-09-21 16:23:16 -04:00 committed by Brian Coca
parent 3f9a885b83
commit 7a312b6cf7
2 changed files with 18 additions and 2 deletions

View file

@ -453,9 +453,9 @@ class CLI(with_metaclass(ABCMeta, object)):
help='the new vault identity to use for rekey') help='the new vault identity to use for rekey')
if subset_opts: if subset_opts:
parser.add_option('-t', '--tags', dest='tags', default=[], action='append', parser.add_option('-t', '--tags', dest='tags', default=C.TAGS_RUN, action='append',
help="only run plays and tasks tagged with these values") help="only run plays and tasks tagged with these values")
parser.add_option('--skip-tags', dest='skip_tags', default=[], action='append', parser.add_option('--skip-tags', dest='skip_tags', default=C.TAGS_SKIP, action='append',
help="only run plays and tasks whose tags do not match these values") help="only run plays and tasks whose tags do not match these values")
if output_opts: if output_opts:

View file

@ -1436,6 +1436,22 @@ SYSTEM_WARNINGS:
ini: ini:
- {key: system_warnings, section: defaults} - {key: system_warnings, section: defaults}
type: boolean type: boolean
TAGS_RUN:
name: Run Tags
default: []
type: list
description: default list of tags to run in your plays, Skip Tags has precedence.
env: [{name: ANSIBLE_RUN_TAGS}]
ini:
- {key: run, section: tags}
TAGS_SKIP:
name: Skip Tags
default: []
type: list
description: default list of tags to skip in your plays, has precedence over Run Tags
env: [{name: ANSIBLE_SKIP_TAGS}]
ini:
- {key: skip, section: tags}
USE_PERSISTENT_CONNECTIONS: USE_PERSISTENT_CONNECTIONS:
name: Persistence name: Persistence
default: False default: False