I have 3 ansible playbook.
my_ansible
├── hosts
├── play1.yaml
├── play2.yaml
├── play3.yaml
└── roles
├── role1
├── role2
└── role3
hosts
[play1]
host1
[play2]
host2
[play3]
host3
Now, when I run play3
, I want to run play2(role2)
on host2
and play1(role1)
on host1
.
I check, role-dependency, but that apply on same host, means, if I add role-dependency
in role3
for role1
and role2
, then these 2 roles will run against host3
.
I want to make sure, play1
runs on host1
only, play2
runs on host2
only and play3
runs on host3
only.
I try to find the playbook
dependency, but no luck yet.
If is there any better way to solve this, then I am ready to head into that way too.