When statement doesn't get evaluated correctly with include

18 views
Skip to first unread message

Rahul Mehrotra

unread,
Apr 13, 2015, 1:25:45 PM4/13/15
to ansible...@googlegroups.com
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.

Reply all
Reply to author
Forward
0 new messages