Play single roles in a playbook

33 views
Skip to first unread message

Daniele Varrazzo

unread,
Feb 12, 2016, 10:21:00 AM2/12/16
to Ansible Project
Hello,

All my playbooks looks like:

    - hosts: web_servers
      roles:
        - role: nginx
          tags: nginx
        - role: web_landing
          tags: web_landing
        - role: web_server
          tags: web_server

because I want to be able to deploy only a certain role or subset of roles sometimes: because I'm developing on these, because a playbook may be huge and people know what bit are to be deployed and so on. And the only way I've found to run only a subset of the playbook is to use tags.

Is there any command-line parameter or other options I'm missing in order to deploy only certain roles in a playbook, without abusing tags?

Thank you very much!

-- Daniele

Matt Martz

unread,
Feb 12, 2016, 10:38:11 AM2/12/16
to ansible...@googlegroups.com
What is the problem with using tags?  We tag every role.  At the moment, we have 65 tags aggregated across site.yml.

tags are designed specifically for this functionality.

--
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/52f56d5d-717a-4fa2-9c14-344153c6f174%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net

Daniele Varrazzo

unread,
Feb 12, 2016, 10:46:32 AM2/12/16
to Ansible Project

On Friday, February 12, 2016 at 3:38:11 PM UTC, Matt Martz wrote:
What is the problem with using tags?  We tag every role.  At the moment, we have 65 tags aggregated across site.yml.

tags are designed specifically for this functionality.

Sure tags work, that's why I use them. But this need of creating 1-1 tags for roles smells like something missing to me (missing as ansible feature or just from my knowledge).

-- Daniele

Mike Biancaniello

unread,
Feb 12, 2016, 11:15:11 AM2/12/16
to Ansible Project
It would be nice if roles could be autotagged with the role name.
Reply all
Reply to author
Forward
0 new messages