Tags on includes only affect the include. FIxes #35729 (#35732)

pull/35608/head
Matt Martz 7 years ago committed by GitHub
parent 3bc1805c10
commit 975f4def78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -91,20 +91,18 @@ You may also apply tags to roles::
roles: roles:
- { role: webserver, port: 5000, tags: [ 'web', 'foo' ] } - { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
And import/include statements:: And import statements::
- import_tasks: foo.yml - import_tasks: foo.yml
tags: [web,foo] tags: [web,foo]
or:: All of these apply the specified tags to EACH task inside the play, imported
- include_tasks: foo.yml
tags: [web,foo]
All of these apply the specified tags to EACH task inside the play, included
file, or role, so that these tasks can be selectively run when the playbook file, or role, so that these tasks can be selectively run when the playbook
is invoked with the corresponding tags. is invoked with the corresponding tags.
The above information does not apply to `include_tasks` or other dynamic includes,
as the attributes applied to an include, only affect the include itself.
Tags are inherited *down* the dependency chain. In order for tags to be applied to a role and all its dependencies, Tags are inherited *down* the dependency chain. In order for tags to be applied to a role and all its dependencies,
the tag should be applied to the role, not to all the tasks within a role. the tag should be applied to the role, not to all the tasks within a role.

Loading…
Cancel
Save