{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/13506","labels_url":"https://api.github.com/repos/ansible/ansible/issues/13506/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/13506/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/13506/events","html_url":"https://github.com/ansible/ansible/issues/13506","id":121540475,"number":13506,"title":"when: statement replaces a variable with the value of another","user":{"login":"alvarogmj","id":837703,"avatar_url":"https://avatars.githubusercontent.com/u/837703?v=3","gravatar_id":"","url":"https://api.github.com/users/alvarogmj","html_url":"https://github.com/alvarogmj","followers_url":"https://api.github.com/users/alvarogmj/followers","following_url":"https://api.github.com/users/alvarogmj/following{/other_user}","gists_url":"https://api.github.com/users/alvarogmj/gists{/gist_id}","starred_url":"https://api.github.com/users/alvarogmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvarogmj/subscriptions","organizations_url":"https://api.github.com/users/alvarogmj/orgs","repos_url":"https://api.github.com/users/alvarogmj/repos","events_url":"https://api.github.com/users/alvarogmj/events{/privacy}","received_events_url":"https://api.github.com/users/alvarogmj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible/labels/needs_info","name":"needs_info","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ansible/ansible/milestones/5","html_url":"https://github.com/ansible/ansible/milestones/v2","labels_url":"https://api.github.com/repos/ansible/ansible/milestones/5/labels","id":975800,"number":5,"title":"v2","description":null,"creator":{"login":"bcoca","id":836171,"avatar_url":"https://avatars.githubusercontent.com/u/836171?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":639,"state":"open","created_at":"2015-02-11T19:43:06Z","updated_at":"2016-01-04T17:57:16Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-12-10T17:41:49Z","updated_at":"2016-01-04T19:10:19Z","closed_at":null,"body":"##### Issue Type:\r\nBug Report\r\n\r\n##### Ansible Version:\r\nLatest beta, from the downloads page (ansible-2.0.0-0.7.rc2.tar.gz)\r\n\r\n##### Ansible Configuration:\r\nStock ansible.cfg + json facts cache enabled\r\n\r\n##### Environment:\r\nRHEL 6, python2.6\r\n\r\n\r\n##### Summary:\r\n\r\nValue of a variable gets changed to the value of another when using includes / when statements.\r\n\r\n##### Steps To Reproduce:\r\n\r\nRun ansible-playbook with the attached test files (changing inventory and host_vars to point to a real server), playbook file is \"node_servers.yml\"\r\n\r\n    ansible-playbook -i inventory node_servers.yml\r\n\r\n##### Expected Results:\r\n\r\nWith the test case, the playbook should fail with the following message:\r\n\r\n    TASK [node_servers : Stop nodes] ***********************************************\r\n    fatal: [avnvld01.sgdcelab.sabre.com]: FAILED! => {\"failed\": true, \"msg\": \"ERROR! The conditional check '{{ 'not_found' != hostvars[inventory_hostname]['app_info_' ~ customer]['version'] }}' failed. The error was: ERROR! 'dict' object has no attribute u\\\"app_info_test\\\"\"}\r\n\r\n##### Actual Results:\r\n\r\nThe value of 'customer' is replaced by the value of the 'hosts' dictionary, loaded from 'test/config/vars.yml' by an include task in install.yml:\r\n\r\n    TASK [node_servers : Stop nodes] ***********************************************\r\n    fatal: [avnvld01.sgdcelab.sabre.com]: FAILED! => {\"failed\": true, \"msg\": \"ERROR! The conditional check '{{ 'not_found' != hostvars[inventory_hostname]['app_info_' ~ customer]['version'] }}' failed. The error was: ERROR! 'dict' object has no attribute u\\\"app_info_{u'name': u'server2.example.com', u'port': 9000}\\\"\"}\r\n\r\nRepository with test files:\r\nhttps://github.com/alvarogmj/ansible-test-case/tree/master/issue13506"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/168773366","html_url":"https://github.com/ansible/ansible/issues/13506#issuecomment-168773366","issue_url":"https://api.github.com/repos/ansible/ansible/issues/13506","id":168773366,"user":{"login":"alvarogmj","id":837703,"avatar_url":"https://avatars.githubusercontent.com/u/837703?v=3","gravatar_id":"","url":"https://api.github.com/users/alvarogmj","html_url":"https://github.com/alvarogmj","followers_url":"https://api.github.com/users/alvarogmj/followers","following_url":"https://api.github.com/users/alvarogmj/following{/other_user}","gists_url":"https://api.github.com/users/alvarogmj/gists{/gist_id}","starred_url":"https://api.github.com/users/alvarogmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvarogmj/subscriptions","organizations_url":"https://api.github.com/users/alvarogmj/orgs","repos_url":"https://api.github.com/users/alvarogmj/repos","events_url":"https://api.github.com/users/alvarogmj/events{/privacy}","received_events_url":"https://api.github.com/users/alvarogmj/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T19:10:19Z","updated_at":"2016-01-04T19:10:19Z","body":"I'd like to know if this will be accepted as a bug or is a side-effect of doing something wrong, so I can avoid the problem entirely. "}}