Skip to content

Commit f2980fc

Browse files
committed
clarify tags (ansible#15647)
* clarify tags * feedback corrections
1 parent 8016f8a commit f2980fc

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

docsite/rst/playbooks_tags.rst

+25-3
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,42 @@ On the other hand, if you want to run a playbook *without* certain tasks, you co
2929

3030
ansible-playbook example.yml --skip-tags "notification"
3131

32+
33+
.. _tag_inheritance:
34+
35+
Tag Inheritance
36+
```````````````
37+
38+
You can apply tags to more than tasks, but they ONLY affect the tasks themselves. Applyng tags anywhere else is just a
39+
convenience so you don't have to write it on every task::
40+
41+
- hosts: all
42+
tags:
43+
- bar
44+
tasks:
45+
...
46+
47+
- hosts: all
48+
tags: ['foo']
49+
tasks:
50+
...
51+
3252
You may also apply tags to roles::
3353

3454
roles:
3555
- { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
3656

37-
And you may also tag basic include statements::
57+
And include statements::
3858

3959
- include: foo.yml
4060
tags: [web,foo]
4161

42-
Both of these apply the specified tags to every task inside the included
43-
file or role, so that these tasks can be selectively run when the playbook
62+
All of these apply the specified tags to EACH task inside the play, included
63+
file, or role, so that these tasks can be selectively run when the playbook
4464
is invoked with the corresponding tags.
4565

66+
.. _special_tags:
67+
4668
Special Tags
4769
````````````
4870

0 commit comments

Comments
 (0)