hosts per role?

34 views
Skip to first unread message

silv...@srebrnysen.com

unread,
Dec 14, 2015, 8:36:49 AM12/14/15
to ansible...@googlegroups.com
We can do something like:

- hosts: group1
roles:
- role1

- hosts: group1:group2
roles:
- role2

- hosts: group2
roles:
- role3

etc, in a playbook. Would it be somehow possible to assign hosts "per role"? Something like:

- hosts: group1
roles:
- { role1, hosts: group3 }
- { role2 }
- { role3 }
- { role4, hosts: group4 }

? The above doesn't seem to work ;-)

Hugh Ma

unread,
Dec 14, 2015, 3:21:30 PM12/14/15
to Ansible Project
I'm not sure I understand what it is your trying to do here...

If you are trying to have some hosts execute another group's role, you can use includes
Otherwise, if you can explain why you are nesting group3/4 under roles when you have group1 set as hosts.
Reply all
Reply to author
Forward
0 new messages