mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
8016f8a638
commit
f2980fc565
1 changed files with 25 additions and 3 deletions
|
@ -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"
|
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::
|
You may also apply tags to roles::
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
|
- { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
|
||||||
|
|
||||||
And you may also tag basic include statements::
|
And include statements::
|
||||||
|
|
||||||
- include: foo.yml
|
- include: foo.yml
|
||||||
tags: [web,foo]
|
tags: [web,foo]
|
||||||
|
|
||||||
Both of these apply the specified tags to every task inside the included
|
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.
|
||||||
|
|
||||||
|
.. _special_tags:
|
||||||
|
|
||||||
Special Tags
|
Special Tags
|
||||||
````````````
|
````````````
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue