list all tags (including never) when listing tags (#80309)

* Ensure we default to show all tags when listing tags

 'never' was being excluded by default,as it is not part of the 'run tags'
 runtime default ('all'). For listing we now add it to the default 'run tags'.
pull/80377/head
Brian Coca 2 years ago committed by GitHub
parent 043a0f3ee8
commit 4b20191c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- list-tags now shows the 'never' tag, which was being excluded by default. To list all tasks you still need to add `--list-tasks --tags never,all`.

@ -65,8 +65,19 @@ class PlaybookCLI(CLI):
self.parser.add_argument('args', help='Playbook(s)', metavar='playbook', nargs='+')
def post_process_args(self, options):
# for listing, we need to know if user had tag input
# capture here as parent function sets defaults for tags
havetags = bool(options.tags or options.skip_tags)
options = super(PlaybookCLI, self).post_process_args(options)
if options.listtags:
# default to all tags (including never), when listing tags
# unless user specified tags
if not havetags:
options.tags = ['never', 'all']
display.verbosity = options.verbosity
self.validate_conflicts(options, runas_opts=True, fork_opts=True)

Loading…
Cancel
Save