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

clarify tags (#15647)

* clarify tags

* feedback corrections
This commit is contained in:
Brian Coca 2016-04-28 10:25:26 -04:00
parent 8016f8a638
commit f2980fc565

View file

@ -29,20 +29,42 @@ On the other hand, if you want to run a playbook *without* certain tasks, you co
ansible-playbook example.yml --skip-tags "notification"
.. _tag_inheritance:
Tag Inheritance
```````````````
You can apply tags to more than tasks, but they ONLY affect the tasks themselves. Applyng tags anywhere else is just a
convenience so you don't have to write it on every task::
- hosts: all
tags:
- bar
tasks:
...
- hosts: all
tags: ['foo']
tasks:
...
You may also apply tags to roles::
roles:
- { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
And you may also tag basic include statements::
And include statements::
- include: foo.yml
tags: [web,foo]
Both of these apply the specified tags to every task inside the included
file or role, so that these tasks can be selectively run when the playbook
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
is invoked with the corresponding tags.
.. _special_tags:
Special Tags
````````````