{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/10460","labels_url":"https://api.github.com/repos/ansible/ansible/issues/10460/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/10460/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/10460/events","html_url":"https://github.com/ansible/ansible/issues/10460","id":61218281,"number":10460,"title":"Conditionals evaluation problem","user":{"login":"beli-sk","id":1942417,"avatar_url":"https://avatars.githubusercontent.com/u/1942417?v=3","gravatar_id":"","url":"https://api.github.com/users/beli-sk","html_url":"https://github.com/beli-sk","followers_url":"https://api.github.com/users/beli-sk/followers","following_url":"https://api.github.com/users/beli-sk/following{/other_user}","gists_url":"https://api.github.com/users/beli-sk/gists{/gist_id}","starred_url":"https://api.github.com/users/beli-sk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beli-sk/subscriptions","organizations_url":"https://api.github.com/users/beli-sk/orgs","repos_url":"https://api.github.com/users/beli-sk/repos","events_url":"https://api.github.com/users/beli-sk/events{/privacy}","received_events_url":"https://api.github.com/users/beli-sk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-13T20:16:52Z","updated_at":"2015-03-13T20:16:52Z","closed_at":null,"body":"I came across a problem with evaluating expressions in ``when`` statement, best shown on an example. Let's consider a playbook like this:\r\n```\r\n---\r\n- connection: local\r\n  hosts: localhost\r\n  vars:\r\n    foo: false\r\n    bar: \"{{ foo }}\"\r\n\r\n  tasks:\r\n    - command: echo {{ bar }}\r\n      when: True and bar\r\n```\r\nI would assume that when bar is false (as seen in output from the echo command), the ``when`` expression should evaluate to false and the task should be skipped. But that's not the case, the task gets executed. Could someone please explain what goes on here? Is this a bug or some side effect? If so, is there a workaround for when I want to set a variable to value of another boolean variable or possibly a more complex expression?\r\n\r\nNote: it's enough to say ``bar: \"{{ false }}\"`` for the same behavior."}}