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:
- { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
And import/include statements::
And import statements::
- import_tasks: foo.yml
tags: [web,foo]
or::
- include_tasks: foo.yml
tags: [web,foo]
All of these apply the specified tags to EACH task inside the play, included
All of these apply the specified tags to EACH task inside the play, imported
file, or role, so that these tasks can be selectively run when the playbook
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,
the tag should be applied to the role, not to all the tasks within a role.