{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/14519","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/14519/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/14519/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/14519/events","html_url":"https://github.com/ansible/ansible/issues/14519","id":134190434,"number":14519,"title":"[2.0] Passing ansible_port through items returns None","user":{"login":"afunix","id":5682770,"avatar_url":"https://avatars.githubusercontent.com/u/5682770?v=3","gravatar_id":"","url":"https://api.github.com/users/afunix","html_url":"https://github.com/afunix","followers_url":"https://api.github.com/users/afunix/followers","following_url":"https://api.github.com/users/afunix/following{/other_user}","gists_url":"https://api.github.com/users/afunix/gists{/gist_id}","starred_url":"https://api.github.com/users/afunix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afunix/subscriptions","organizations_url":"https://api.github.com/users/afunix/orgs","repos_url":"https://api.github.com/users/afunix/repos","events_url":"https://api.github.com/users/afunix/events{/privacy}","received_events_url":"https://api.github.com/users/afunix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-17T06:22:54Z","updated_at":"2016-02-17T06:47:07Z","closed_at":null,"body":"##### Issue Type:\r\n\r\n  - Bug Report\r\n\r\n##### Ansible Version:\r\n\r\nansible 2.0.1.0 (stable-2.0 bec698052f) last updated 2016/02/16 13:32:47 (GMT +300)\r\n  lib/ansible/modules/core: (detached HEAD 9552a22b83) last updated 2016/02/16 16:09:13 (GMT +300)\r\n  lib/ansible/modules/extras: (detached HEAD 51cddf2b35) last updated 2016/02/16 16:09:14 (GMT +300)\r\n  config file = \r\n  configured module search path = Default w/o overrides\r\n\r\n##### Ansible Configuration:\r\n\r\nI don't have ansible.cfg in /etc/ansible\r\n\r\n##### Environment:\r\n\r\nMac OS X 10.11.3\r\n\r\n##### Summary:\r\n\r\nI found that {{ansible_port}} passed through with_items section to my tasks are evaluated to None after upgrade to ansible-2.0.\r\n\r\n##### Steps To Reproduce:\r\n\r\n```\r\n$ cat inventory \r\ntest1\r\ntest2 ansible_port=22222\r\n\r\n$ cat playbook.yml \r\n---\r\n- hosts: all\r\n  tasks:\r\n    - debug:\r\n        msg: \"plain: {{ansible_port}}\"\r\n\r\n- hosts: all\r\n  tasks:\r\n    - debug:\r\n        msg: \"items: {{item}}\"\r\n      with_items:\r\n        - \"{{ansible_port}}\"\r\n\r\n$ ansible-playbook -i inventory --connection=local playbook.yml\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [test2]\r\nok: [test1]\r\n\r\nTASK [debug] *******************************************************************\r\nok: [test1] => {\r\n    \"msg\": \"plain: \"\r\n}\r\nok: [test2] => {\r\n    \"msg\": \"plain: 22222\"\r\n}\r\n\r\nPLAY ***************************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [test2]\r\nok: [test1]\r\n\r\nTASK [debug] *******************************************************************\r\nok: [test1] => (item=None) => {\r\n    \"item\": null, \r\n    \"msg\": \"items: \"\r\n}\r\nok: [test2] => (item=None) => {\r\n    \"item\": null, \r\n    \"msg\": \"items: \"\r\n}\r\n\r\nPLAY RECAP *********************************************************************\r\ntest1                      : ok=4    changed=0    unreachable=0    failed=0   \r\ntest2                      : ok=4    changed=0    unreachable=0    failed=0   \r\n\r\n```\r\n\r\n\r\n##### Expected Results:\r\n\r\nBoth tasks should generate None for host test1 and 22222 for host test2.\r\n\r\n##### Actual Results:\r\n\r\nThe first task is evaluated {{ansible_host}} correctly to None & 22222, while the second task evaluated the variable to None & None.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/185054665","html_url":"https://github.com/ansible/ansible/issues/14519#issuecomment-185054665","issue_url":"https://api.github.com/repos/ansible/ansible/issues/14519","id":185054665,"user":{"login":"afunix","id":5682770,"avatar_url":"https://avatars.githubusercontent.com/u/5682770?v=3","gravatar_id":"","url":"https://api.github.com/users/afunix","html_url":"https://github.com/afunix","followers_url":"https://api.github.com/users/afunix/followers","following_url":"https://api.github.com/users/afunix/following{/other_user}","gists_url":"https://api.github.com/users/afunix/gists{/gist_id}","starred_url":"https://api.github.com/users/afunix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afunix/subscriptions","organizations_url":"https://api.github.com/users/afunix/orgs","repos_url":"https://api.github.com/users/afunix/repos","events_url":"https://api.github.com/users/afunix/events{/privacy}","received_events_url":"https://api.github.com/users/afunix/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T06:47:06Z","updated_at":"2016-02-17T06:47:06Z","body":"Using git bisect found the offending commit: `a703f3a6d2e4df9c74a1f1b3504ad8dc92acd0dd`"}}