1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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

This commit is contained in:
Matt Martz 2018-02-05 09:53:56 -06:00 committed by GitHub
parent 3bc1805c10
commit 975f4def78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.