mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 21:30:22 -07:00
Allow include statements from plays to specify tags (see tags.yml example file).
Also be smart and don't run a play at all if no tasks in the play match any of the tags specified. This includes not running the setup actions!
This commit is contained in:
parent
83f23ef861
commit
969c3feb13
4 changed files with 28 additions and 11 deletions
|
@ -62,6 +62,9 @@ class Task(object):
|
|||
if len(tokens) > 1:
|
||||
self.module_args = tokens[1]
|
||||
|
||||
import_tags = []
|
||||
if 'tags' in self.module_vars:
|
||||
import_tags = self.module_vars['tags'].split(",")
|
||||
|
||||
self.name = utils.template(self.name, self.module_vars)
|
||||
self.action = utils.template(self.name, self.module_vars)
|
||||
|
@ -78,7 +81,7 @@ class Task(object):
|
|||
self.tags.append(apply_tags)
|
||||
elif type(apply_tags) == list:
|
||||
self.tags.extend(apply_tags)
|
||||
|
||||
self.tags.extend(import_tags)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue