playbooks include statement

57 views
Skip to first unread message

Marc Petrivelli

unread,
May 30, 2014, 9:52:00 AM5/30/14
to ansible...@googlegroups.com
Is there any reason why I can't apply a tag to a playbook include?  I have the following:

- { include: dhcpservers.yml tags=dhcp, when: ansible_system == 'Linux' }

but the dhcp tag seems to be ignored.  Am I missing something?  Does this work for other people?

Michael DeHaan

unread,
May 31, 2014, 12:19:46 PM5/31/14
to ansible...@googlegroups.com
Yes.  Spite.

Tasks are tagged (roles collect tasks), not playbooks.



--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bea243c5-c606-4f8a-b1c1-a946b6aa6479%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marc Petrivelli

unread,
Jun 19, 2014, 2:25:32 PM6/19/14
to ansible...@googlegroups.com
Turns out I make most of technical decisions based on spite:)

But plays in playbooks can be tagged which are in turn composed of roles and tasks.  It just seems you might want to "tag" a playbook as having a certain category of functionality.  Basically I need to do this because I am trying to put together one site level playbook that can execute all my plays with selective execution based on command line arguments (ie tags).  I might need to rethink that.

Michael DeHaan

unread,
Jun 19, 2014, 5:35:08 PM6/19/14
to ansible...@googlegroups.com
" It just seems you might want to "tag" a playbook as having a certain category of functionality."

You can tag individual plays, but not whole playbooks.   Should be good enough.

This will apply he the tag to all tasks (whether in roles or not) therein.




Reply all
Reply to author
Forward
0 new messages