role-main1/meta/main.yml
---
dependencies:
- { role: role-dependency }
role-main2/meta/main.yml---
dependencies:
- { role: role-dependency }
role-dependency/meta/main.yml---
allow_duplicates: yes
Now, I have a playbook which calls the roles role-main1 and role-main2 based on some condition
- { role: role-main1, when: (z1|bool) }
- { role: role-main2, when: (z2|bool) }Everything works fine if both the conditions are met and both roles get called
if z1=true z2=true
1. role-dependency => executed 2. role-main1 => executed 3. role-dependency => executed 4. role-main2 => executedBut if the first condition fails then the dependency fails to execute even for the second roleIf z1=false z2=true
1. role-dependency => skipped 2. role-main1 => skipped 3. role-dependency => skipped (We were expecting this to be executed) 4. role-main2 => executedThis was working in my earlier version of ansible (1.8.4), I even tested it in 1.9 version and it worked fine. It seems to be broken in ansible 2 series.Can someone help here.ThanksDeep