You could always create a separate file with something like:
-
hosts: all
roles:
- role1
- role2
ansible-playbook -i hosts the_file_above.yml --limit host1,host2
It gets cumbersome to edit that file or create new ones all the time
though, but I don't know of a better way. I always tag all my tasks inside
roles with sensible tags to easily filter with --tags / --skip-tags, though.
On Wednesday, January 21, 2015 at 12:03:34 PM UTC+1, Andrew Craft wrote:
>
> In the same way that you can use tags to target specific tasks in a large
> playbook, is it possible to filter by roles? Tags are useful but often find
> i am tagging all tasks in a role with same tag so i can run just those,
> would be nice if I could use roles in a similar way to filter as tags?
>
> thanks
>
--
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/f9b4e662-fbc3-4297-b89b-7a7038f212d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.