mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
docsite/rst/playbooks_tags.rst: Added section on tag reuse (#17729)
* docsite/rst/playbooks_tags.rst: Added section on tag reuse * Update playbooks_tags.rst Minor grammatical clarification.
This commit is contained in:
parent
387ad9a980
commit
fe95d71fbd
1 changed files with 25 additions and 0 deletions
|
@ -30,6 +30,31 @@ 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_reuse:
|
||||||
|
|
||||||
|
Tag Resuse
|
||||||
|
```````````````
|
||||||
|
You can apply the same tag name to more than one task, in the same file
|
||||||
|
or included files. This will run all tasks with that tag.
|
||||||
|
|
||||||
|
Example::
|
||||||
|
---
|
||||||
|
# file: roles/common/tasks/main.yml
|
||||||
|
|
||||||
|
- name: be sure ntp is installed
|
||||||
|
yum: name=ntp state=installed
|
||||||
|
tags: ntp
|
||||||
|
|
||||||
|
- name: be sure ntp is configured
|
||||||
|
template: src=ntp.conf.j2 dest=/etc/ntp.conf
|
||||||
|
notify:
|
||||||
|
- restart ntpd
|
||||||
|
tags: ntp
|
||||||
|
|
||||||
|
- name: be sure ntpd is running and enabled
|
||||||
|
service: name=ntpd state=started enabled=yes
|
||||||
|
tags: ntp
|
||||||
|
|
||||||
.. _tag_inheritance:
|
.. _tag_inheritance:
|
||||||
|
|
||||||
Tag Inheritance
|
Tag Inheritance
|
||||||
|
|
Loading…
Reference in a new issue