I'm really puzzled by how a certain Ansible feature appears to work, and I can't figure out why anyone in the world would ever want it to work that way. I hope that I'm just densely mis-interpreting how it works.
It seems that the *when:* attribute for the *include:* task doesn't actually constrain *when* the specified playbook is included. Rather, the specified playbook is *always* included, and *every* task within the playbook is executed, with the original *when:* clause applied to the task. This doesn't make any sense whatsoever. I cannot think of a single use case for this. On the one hand, if *when:* evaluates to *false*, then every task within the playbook will be skipped. If it evaluates to *true*, every task within the playbook will be executed. That sounds like a really stupid alternative to only including the playbook when *when:* evaluates to *true*. In fact, this implementation actually prevents us from conditionally including a playbook only if it hasn't been included before, which seems like a really useful feature in general, and one of the strategies I was hoping to use in order to compensate for Ansible's really terrible lack of composable language constructs. What am I missing? -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4e0f8c0d-b1d2-4244-ad58-326be9fcdc0f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.