Hello,
I need to limit ansible to run specific role by limiting with groups in inventory. The inventory and role layouts listed below cannot be changed in our environment.
For example :
Inventory (all three groups have same server) :
[group1]
server1
[group2]
server1
[group3]
server1
Playbook:
-
hosts: group1
roles: role1 -
hosts: group2
roles: role2 -
hosts: group3
roles: role3
When I run this :
ansible-playbook test.yml -i <> -t update_config -C -K -l ‘group1’
This is running all the roles. I understand since the target is a single node and it is in all groups, it is by design to work like this. But is there are any workaround for this to limit running role to specific group. (Not by using specific tags again since we already have multiple tags within our roles)