Lets say for example, you have a role which is tagged with "foo", and some
individual tasks within that role are tagged with "bar".

If you run Ansible with --tags=foo, all tasks within that role would be
executed. If you used --tags=bar instead, only those tasks within that role
tagged as such would be run.

Regarding your second question, in combination to my response on your other
post you can combine --tags with the --limit @retry.file, --step or
--start-at-task options to further limit your executions.


On Wed, Sep 17, 2014 at 12:29 PM, Hilco Wijbenga <[email protected]>
wrote:

> On 17 September 2014 10:23, James Cammarata <[email protected]>
> wrote:
> > You can definitely group tasks within roles using any tags you want, and
> you
> > can tag the roles themselves. The tags applied to the role will also
> apply
> > to all tasks/handlers within that role as well.
>
> How would that work then? I know how to limit a run to just a tag
> (--tags "tag-1") on the command line but how would that work in a
> playbook or a role? How do you "enable" a tag based on the results of
> a previous task?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAE1pOi2aLn1Nmay0VC%3D69%2Bz%3DoCqRis6%2BKV66Z0UWHO_ux9L2bw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAMFyvFixC%3DTFQ1BWs9D%3DeOOM6DEK16EnvZ3TYne0FNZr_5C%2BeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to