mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Basic support for tagging tasks and selecting a subset of tasks to run with --tags.
This commit is contained in:
29
examples/playbooks/tags.yml
Normal file
29
examples/playbooks/tags.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# tags allow us to run all of a playbook or part of it.
|
||||
#
|
||||
# assume: ansible-playbook tags.yml --tags foo
|
||||
#
|
||||
# only tags with the given tags will be run when --tags is specified
|
||||
#
|
||||
# (an include statement will also be able to set tags on all included
|
||||
# tasks at some point in the future)
|
||||
|
||||
|
||||
- name: example play
|
||||
hosts: all
|
||||
user: root
|
||||
tasks:
|
||||
- name: hi
|
||||
tags: foo
|
||||
action: shell echo "first play ran"
|
||||
|
||||
- name: example play
|
||||
hosts: all
|
||||
user: root
|
||||
tasks:
|
||||
- name: hi
|
||||
tags: bar
|
||||
action: shell echo "second play ran"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user