Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
af573db4
Commit
af573db4
authored
Feb 12, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documented new tag behaviour
parent
65c08d13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
docsite/rst/playbooks_tags.rst
+25
-3
No files found.
docsite/rst/playbooks_tags.rst
View file @
af573db4
Tags
Tags
====
====
If you have a large playbook it may become useful to be able to run a
If you have a large playbook it may become useful to be able to run a
specific part of the configuration without running the whole playbook.
specific part of the configuration without running the whole playbook.
Both plays and tasks support a "tags:" attribute for this reason.
Both plays and tasks support a "tags:" attribute for this reason.
...
@@ -24,7 +24,7 @@ Example::
...
@@ -24,7 +24,7 @@ Example::
If you wanted to just run the "configuration" and "packages" part of a very long playbook, you could do this::
If you wanted to just run the "configuration" and "packages" part of a very long playbook, you could do this::
ansible-playbook example.yml --tags "configuration,packages"
ansible-playbook example.yml --tags "configuration,packages"
On the other hand, if you want to run a playbook *without* certain tasks, you could do this::
On the other hand, if you want to run a playbook *without* certain tasks, you could do this::
ansible-playbook example.yml --skip-tags "notification"
ansible-playbook example.yml --skip-tags "notification"
...
@@ -40,6 +40,28 @@ And you may also tag basic include statements::
...
@@ -40,6 +40,28 @@ And you may also tag basic include statements::
Both of these have the function of tagging every single task inside the include statement.
Both of these have the function of tagging every single task inside the include statement.
Special Tags
````````````
There is a special 'always' tag that will always run a task, unless specifically skipped (--skip-tags always)
Example::
tasks:
- debug: msg="Always runs"
tags:
- always
- debug: msg="runs when you use tag1"
tags:
- tag1
There are another 3 special keywords for tags, 'tagged', 'untagged' and 'all', which run only tagged, only untagged
and all tasks respectively. By default ansible runs as if --tags all had been specified.
.. seealso::
.. seealso::
:doc:`playbooks`
:doc:`playbooks`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment