mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
adds complex tag management
Adds a special tag: - always: always runs no matter what --tags, --skip-tags say Adds 4 special keywords for --tags/skip-tags - all: all tagged + untagged tasks - tagged: only tagged tasks - untagged: only untagged tasks - always: only run tasks tagged 'always'
This commit is contained in:
parent
f61de115cd
commit
95fa770ba0
3 changed files with 59 additions and 14 deletions
|
@ -129,7 +129,7 @@ class Task(object):
|
|||
|
||||
# load various attributes
|
||||
self.name = ds.get('name', None)
|
||||
self.tags = [ 'all' ]
|
||||
self.tags = [ 'untagged' ]
|
||||
self.register = ds.get('register', None)
|
||||
self.sudo = utils.boolean(ds.get('sudo', play.sudo))
|
||||
self.su = utils.boolean(ds.get('su', play.su))
|
||||
|
@ -316,6 +316,9 @@ class Task(object):
|
|||
self.tags.extend(apply_tags)
|
||||
self.tags.extend(import_tags)
|
||||
|
||||
if len(self.tags) > 1:
|
||||
self.tags.remove('untagged')
|
||||
|
||||
if additional_conditions:
|
||||
new_conditions = additional_conditions[:]
|
||||
if self.when:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue