when statement doesn't get evaluated properly and always returns true when used in combination of include statement
to reproduce the error *site.yml* --- - include: rds/rds.yml - include: elasticache/elasticache.yml - include: acralyzer.yml when: env == "prod" - { include: npmserver.yml, when: env == "prod" } then executing using the following statement ansible-playbook site.yml --ask-vault-pass --extra-vars "env=dev" -vvvv irrespective of the value of *env* when statement gets evaluated as true and npmserver.yml & acralyzer.yml gets executed. -- 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/7a999bb0-73b7-4043-9689-a5ff91ec4c96%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.