How to run role with a particular tag in a playbook?

32 views
Skip to first unread message

Dmitry Owl

unread,
May 17, 2016, 12:22:32 PM5/17/16
to Ansible Project
Hello, I need to run role in a playbook with a particular tag, without "--tags" option. Something like this:

- hosts: somehost
  remote_user
: someuser
  roles
:
   
- { role: somerole, with-tags: 'sometag' }

I expect that role will run only with the tag "sometag".
This functionality exists? I read docs and can't find anything like my example above.

Arbab Nazar

unread,
May 17, 2016, 1:36:56 PM5/17/16
to Ansible Project
I think you are looking this one:

- hosts: somehost
  remote_user
: someuser
  roles
:

   
- { role: somerole, tags: 'sometag' }

Brian Coca

unread,
May 17, 2016, 1:38:09 PM5/17/16
to ansible...@googlegroups.com
no, that will tag all tasks in the role with 'sometag'. The functionality does not current exist to select a tag on role import.

--
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/16cf1980-d7df-4dc5-b51b-686e4327511a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
----------
Brian Coca

Dmitry Owl

unread,
May 18, 2016, 7:07:37 PM5/18/16
to Ansible Project
Thank you.

вторник, 17 мая 2016 г., 20:38:09 UTC+3 пользователь Brian Coca написал:
Reply all
Reply to author
Forward
0 new messages