Print shell output for each item in Ansible?
<p>I want to execute several commands using the "with_items" construct in Ansible. If a command failed I want to print its standard output. I have made a minimal example to illustrate the problem.</p>

<pre><code>- action: shell echo {{item}}
  with_items:
  - 1
  - 2
  register: task

- debug: var=item.stdout_lines
  with_items: "{{task.results}}"
</code></pre>

<p>The problem is that not only stdout line is printed. How can I fix this?</p>