{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/15694","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/15694/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/15694/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/15694/events","html_url":"https://github.com/ansible/ansible/issues/15694","id":152692612,"number":15694,"title":"Regression in delegate_to: {{ item }} delegate_facts: true","user":{"login":"chrismeyersfsu","id":722880,"avatar_url":"https://avatars.githubusercontent.com/u/722880?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismeyersfsu","html_url":"https://github.com/chrismeyersfsu","followers_url":"https://api.github.com/users/chrismeyersfsu/followers","following_url":"https://api.github.com/users/chrismeyersfsu/following{/other_user}","gists_url":"https://api.github.com/users/chrismeyersfsu/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismeyersfsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismeyersfsu/subscriptions","organizations_url":"https://api.github.com/users/chrismeyersfsu/orgs","repos_url":"https://api.github.com/users/chrismeyersfsu/repos","events_url":"https://api.github.com/users/chrismeyersfsu/events{/privacy}","received_events_url":"https://api.github.com/users/chrismeyersfsu/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/P2","name":"P2","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"jimi-c","id":26403,"avatar_url":"https://avatars.githubusercontent.com/u/26403?v=3","gravatar_id":"","url":"https://api.github.com/users/jimi-c","html_url":"https://github.com/jimi-c","followers_url":"https://api.github.com/users/jimi-c/followers","following_url":"https://api.github.com/users/jimi-c/following{/other_user}","gists_url":"https://api.github.com/users/jimi-c/gists{/gist_id}","starred_url":"https://api.github.com/users/jimi-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimi-c/subscriptions","organizations_url":"https://api.github.com/users/jimi-c/orgs","repos_url":"https://api.github.com/users/jimi-c/repos","events_url":"https://api.github.com/users/jimi-c/events{/privacy}","received_events_url":"https://api.github.com/users/jimi-c/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ansible/ansible/milestones/6","html_url":"https://github.com/ansible/ansible/milestones/2.1.0","labels_url":"https://api.github.com/repos/ansible/ansible/milestones/6/labels","id":995714,"number":6,"title":"2.1.0","description":"","creator":{"login":"abadger","id":209242,"avatar_url":"https://avatars.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"open_issues":114,"closed_issues":149,"state":"open","created_at":"2015-02-25T19:26:53Z","updated_at":"2016-05-04T18:47:46Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-05-03T03:26:55Z","updated_at":"2016-05-04T19:24:32Z","closed_at":null,"body":"\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n\r\n##### ANSIBLE VERSION\r\n`v2.1.0.0-0.1.rc1`\r\n\r\n```\r\nansible 2.1.0.0 (detached HEAD 5954a82dd6) last updated 2016/05/02 23:17:06 (GMT -400)\r\n  lib/ansible/modules/core: (detached HEAD ce79e7c72d) last updated 2016/05/02 23:17:08 (GMT -400)\r\n  lib/ansible/modules/extras: (detached HEAD 156a8cd0b3) last updated 2016/05/02 23:17:08 (GMT -400)\r\n  config file = /Users/meyers/ansible/examples/ansible_performance/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### CONFIGURATION\r\nNone\r\n\r\n##### OS / ENVIRONMENT\r\nMac OS X\r\n\r\n##### SUMMARY\r\n`set_fact` fails with a traceback when using `{{ item }}` in `delegate_to` with `delegate_facts: true` \r\n\r\n##### STEPS TO REPRODUCE\r\n`ansible-playbook -i inventory main.yml -vvvv`\r\n```\r\n# inventory\r\nhost1\r\nlocalhost\r\n\r\n[all:vars]\r\nansible_connection=local\r\n```\r\n\r\n```\r\n- hosts: localhost\r\n  tasks:\r\n    - set_fact:\r\n        foo: \"bar\"\r\n      delegate_to: \"{{ item }}\"\r\n      delegate_facts: true\r\n      with_items:\r\n        - host1\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\nSuccess!\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with high verbosity (-vvvv) -->\r\n\r\n```\r\nNo config file found; using defaults\r\nLoaded callback default of type stdout, v2.0\r\n\r\nPLAYBOOK: main.yml *************************************************************\r\n1 plays in main.yml\r\n\r\nPLAY [localhost] ***************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\n<localhost> ESTABLISH LOCAL CONNECTION FOR USER: meyers\r\n<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo $HOME/.ansible/tmp/ansible-tmp-1462245894.94-220195374966035 `\" && echo \"` echo $HOME/.ansible/tmp/ansible-tmp-1462245894.94-220195374966035 `\" )'\r\n<localhost> PUT /var/folders/3j/jfj3hzx55nvgvmw983jr7n2m0000gn/T/tmppsN1xj TO /Users/meyers/.ansible/tmp/ansible-tmp-1462245894.94-220195374966035/setup\r\n<localhost> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /Users/meyers/.ansible/tmp/ansible-tmp-1462245894.94-220195374966035/setup; rm -rf \"/Users/meyers/.ansible/tmp/ansible-tmp-1462245894.94-220195374966035/\" > /dev/null 2>&1'\r\nok: [localhost]\r\n\r\nTASK [set_fact] ****************************************************************\r\ntask path: /Users/meyers/ansible/examples/bugs/set_fact_delegate_facts/main.yml:3\r\nok: [localhost -> host1] => (item=host1) => {\"ansible_facts\": {\"foo\": \"bar\"}, \"changed\": false, \"invocation\": {\"module_args\": {\"foo\": \"bar\"}, \"module_name\": \"set_fact\"}, \"item\": \"host1\"}\r\nERROR! Unexpected Exception: 'NoneType' object does not support item assignment\r\nthe full traceback was:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/meyers/ansible/ansible/bin/ansible-playbook\", line 92, in <module>\r\n    exit_code = cli.run()\r\n  File \"/Users/meyers/ansible/ansible/lib/ansible/cli/playbook.py\", line 154, in run\r\n    results = pbex.run()\r\n  File \"/Users/meyers/ansible/ansible/lib/ansible/executor/playbook_executor.py\", line 141, in run\r\n    result = self._tqm.run(play=play)\r\n  File \"/Users/meyers/ansible/ansible/lib/ansible/executor/task_queue_manager.py\", line 246, in run\r\n    play_return = strategy.run(iterator, play_context)\r\n  File \"/Users/meyers/ansible/ansible/lib/ansible/plugins/strategy/linear.py\", line 268, in run\r\n    results += self._wait_on_pending_results(iterator)\r\n  File \"/Users/meyers/ansible/ansible/lib/ansible/plugins/strategy/__init__.py\", line 391, in _wait_on_pending_results\r\n    results = self._process_pending_results(iterator)\r\n  File \"/Users/meyers/ansible/ansible/lib/ansible/plugins/strategy/__init__.py\", line 339, in _process_pending_results\r\n    task_vars[loop_var] = item\r\nTypeError: 'NoneType' object does not support item assignment\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/216973497","html_url":"https://github.com/ansible/ansible/issues/15694#issuecomment-216973497","issue_url":"https://api.github.com/repos/ansible/ansible/issues/15694","id":216973497,"user":{"login":"abadger","id":209242,"avatar_url":"https://avatars.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T19:24:32Z","updated_at":"2016-05-04T19:24:32Z","body":"First bad commit is 6eefc11c3954cbdd2f439c0fad0b9527461b4383\r\n\r\nAssigning to @jimi-c to take a look at."}}