Basic support for tagging tasks and selecting a subset of tasks to run with --tags.

This commit is contained in:
Michael DeHaan
2012-07-11 19:51:26 -04:00
parent fd7e96d33e
commit 83f23ef861
5 changed files with 71 additions and 8 deletions

View 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"