{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/16222","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/16222/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/16222/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/16222/events","html_url":"https://github.com/ansible/ansible/issues/16222","id":159551928,"number":16222,"title":"Ansible evaluates with_items for tasks in blocks skipped by the block when condition","user":{"login":"willthames","id":391807,"avatar_url":"https://avatars.githubusercontent.com/u/391807?v=3","gravatar_id":"","url":"https://api.github.com/users/willthames","html_url":"https://github.com/willthames","followers_url":"https://api.github.com/users/willthames/followers","following_url":"https://api.github.com/users/willthames/following{/other_user}","gists_url":"https://api.github.com/users/willthames/gists{/gist_id}","starred_url":"https://api.github.com/users/willthames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willthames/subscriptions","organizations_url":"https://api.github.com/users/willthames/orgs","repos_url":"https://api.github.com/users/willthames/repos","events_url":"https://api.github.com/users/willthames/events{/privacy}","received_events_url":"https://api.github.com/users/willthames/received_events","type":"User","site_admin":false},"labels":[{"id":48276055,"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2016-06-10T03:22:15Z","updated_at":"2016-11-23T11:55:06Z","closed_at":"2016-06-10T17:29:07Z","body":"##### ISSUE TYPE\n- Bug Report\n##### ANSIBLE VERSION\n\n```\nansible 2.2.0 (devel 10860c50bd) last updated 2016/06/10 10:41:16 (GMT +1000)\n  lib/ansible/modules/core: (detached HEAD 138430f116) last updated 2016/06/10 13:15:56 (GMT +1000)\n  lib/ansible/modules/extras: (detached HEAD 883ccbefe5) last updated 2016/06/10 13:13:56 (GMT +1000)\n  config file = \n  configured module search path = Default w/o overrides\n```\n##### CONFIGURATION\n\nN/A\n##### OS / ENVIRONMENT\n\nN/A\n##### SUMMARY\n\nwith_items is evaluated even during a skipped block - if the with_items uses a result from a previous task in the block, a deprecation error is printed:\n\n```\n[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal error.: 'dict object' has no attribute 'stdout_lines'.\nThis feature will be removed in a \nfuture release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.\n```\n##### STEPS TO REPRODUCE\n\n```\n- hosts: localhost\n  connection: local\n  vars:\n    run_block: true\n\n  tasks:\n  - block:\n    - name: say hello\n      command: echo hello\n      register: hello\n\n    - name: do something with results from say hello task\n      command: echo {{ item }}\n      with_items: \"{{ hello.stdout_lines }}\"\n    when: run_block\n```\n\nansible-playbook -i localhost, skip_when.yml -e run_block=False\n##### EXPECTED RESULTS\n\nAll tasks skipped, no error message\n##### ACTUAL RESULTS\n\n```\nansible-playbook -i localhost, skip_when.yml -e run_block=False\n\nPLAY [localhost] ***************************************************************\n\nTASK [setup] *******************************************************************\nok: [localhost]\n\nTASK [say hello] ***************************************************************\nskipping: [localhost]\n\nTASK [do something with results from say hello task] ***************************\n[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal error.: 'dict object' has no attribute 'stdout_lines'.\nThis feature will be removed in a \nfuture release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.\nskipping: [localhost]\n\nPLAY RECAP *********************************************************************\nlocalhost                  : ok=1    changed=0    unreachable=0    failed=0  \n```\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/262494737","html_url":"https://github.com/ansible/ansible/issues/16222#issuecomment-262494737","issue_url":"https://api.github.com/repos/ansible/ansible/issues/16222","id":262494737,"user":{"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},"created_at":"2016-11-23T11:55:06Z","updated_at":"2016-11-23T11:55:06Z","body":"@geerlingguy or @stefanhorning can I get a reproducer of what you're seeing even after the patch above?"}}
{"actor":{"display_login":"jimi-c"}}