Hi, I'm experiencing exactly the same issue. I found there is a property "allow_duplicates" (see http://docs.ansible.com/ansible/playbooks_roles.html) but that doesn't seem to work for dependent roles ...
Best regards, Martin On Friday, June 17, 2016 at 1:36:48 AM UTC+2, [email protected] wrote: > > Hi, > > I am also having slightly related problem. > > My roles structure are as follows > > role-main1/meta/main.yml > --- > dependencies: > - { role: common } > > > role-main2/meta/main.yml > --- > dependencies: > - { role: common } > > Now I have a top level playbook which calls both these roles one after the > another. > main.yml > --- > - role: role-main1 > - role: role-main2 > The problem is ansible is skipping common dependency in first role and > installing in second role. Skip reason is "Conditional check failed". But I > don't have any condition defined for this dependency. And same dependency > gets executed in the second role. > > The document says that ansible run in for the first role and skip it for > second one. which is exactly what I want and this was working in 1.8. > Is anything changed in ansible 2.0? or it is possible some global > condition is getting applied to this task? So far I am unable to find any > global condition which will cause this. > > On Tuesday, March 8, 2016 at 5:54:59 AM UTC-8, [email protected] wrote: >> >> Hi, >> >> I was trying to upgrade from ansible 1.8.4 to ansible 2, and noticed that >> some of my roles with meta dependencies stopped working. >> >> I have these roles >> >> 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 => executed >> >> >> But if the first condition fails then the dependency fails to execute even >> for the second role >> >> If 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 => executed >> >> >> This 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. >> >> >> Thanks >> >> Deep >> >> >> -- 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/431a42f6-af44-45d5-b9f1-d2301a4fcec2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
