Using "when" with dependent roles

Hello,

I recently upgraded to Ansible 2.0 and have noticed a change in behavior with how dependent roles in meta/main.yml are executed. For example:
dependencies:

  • { role: role1, when: trigger }
  • { role: role2, when: not trigger }

In Ansible 1.9, I could set trigger == True or trigger == False and only one of these two dependent roles would execute. Now, it doesn’t seem to matter what trigger is set to, both are executed. Does the “when” conditional no longer work in dependent roles?

Thanks,

Andrew

I recently upgraded to Ansible 2.0 and have noticed a change in behavior
with how dependent roles in meta/main.yml are executed. For example:
dependencies:
- { role: role1, when: trigger }
- { role: role2, when: not trigger }

In Ansible 1.9, I could set trigger == True or trigger == False and
only one of these two dependent roles would execute. Now, it doesn't
seem to matter what trigger is set to, both are executed. Does the
"when" conditional no longer work in dependent roles?

I had stashed this note away because we use this construction a fair bit,
and if it had stopped working in 2.x, we'd have a lot of refiguring to do.
It seems to work for us, though, in 2.1.1.0... Is it still not working for you?

                                      -Josh (jbs@care.com)

This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.