title: Ansible 2.8.6 iterate over list nested in dictionary
body: <p>With ansible 2.8.6 I run  a shell command and i want to get the stdout_lines.</p>
  <p>For example:</p>
  <pre><code>- name: Find the output
    shell: ls -1 /example
    register: examples
    changed_when: False
  </code></pre>
  <p><code>examples</code> is a dictionary and later on I want to use the <code>examples.stdout_lines</code> which is a list.</p>
  <pre><code>- name: iterate the output
    shell: &quot;echo '- - -' &gt; /example/{{ item }}&quot;
    with_items: &quot;{{ examples.stdout_lines  }}&quot;
    changed_when: False
  </code></pre>
  <p>But it returns an error:</p>
  <pre><code>The full traceback is:
  Traceback (most recent call last):
    File &quot;/usr/local/lib/python3.6/dist-packages/ansible-2.8.6-py3.6.egg/ansible/executor/task_executor.py&quot;, line 103, in run
      items = self._get_loop_items()
    File &quot;/usr/local/lib/python3.6/dist-packages/ansible-2.8.6-py3.6.egg/ansible/executor/task_executor.py&quot;, line 232, in _get_loop_items
      convert_bare=False)
    File &quot;/usr/local/lib/python3.6/dist-packages/ansible-2.8.6-py3.6.egg/ansible/utils/listify.py&quot;, line 33, in listify_lookup_plugin_terms
      terms = templar.template(terms.strip(), convert_bare=convert_bare, fail_on_undefined=fail_on_undefined)
    File &quot;/usr/local/lib/python3.6/dist-packages/ansible-2.8.6-py3.6.egg/ansible/template/__init__.py&quot;, line 548, in template
      eval_results = safe_eval(result, include_exceptions=True)
    File &quot;/usr/local/lib/python3.6/dist-packages/ansible-2.8.6-py3.6.egg/ansible/template/safe_eval.py&quot;, line 108, in safe_eval
      filter_list.extend(filter_.filters().keys())
  AttributeError: 'list' object has no attribute 'keys'
  </code></pre>
  <p>Any ideas on what could be wrong?</p>
  <p><strong>EDIT: this is the debug output</strong></p>
  <pre><code>TASK [role: debug] ******************************************************************************************************************************************************************************
  
  Wednesday 10 February 2021  **** 
  
  ok: [vm0] =&gt; {
      &quot;msg&quot;: &quot; stdout_lines =  ['host0', 'host1', 'host2'] scsi_hosts = {'changed': False, 'end': '2021-02-10 ', 'stdout': 'host0\\nhost1\\nhost2', 'cmd': 'ls -1 /sys/class/scsi_host/', 'rc': 0, 'start': '2021-02-10', 'stderr': '', 'delta': '0:00:00.003999', 'stdout_lines': ['host0', 'host1', 'host2'], 'stderr_lines': [], 'failed': False}&quot;
  }
  ok: [vm1] =&gt; {
      &quot;msg&quot;: &quot; stdout_lines =  ['host0', 'host1', 'host2'] scsi_hosts = {'changed': False, 'end': '2021-02-10', 'stdout': 'host0\\nhost1\\nhost2', 'cmd': 'ls -1 /sys/class/scsi_host/', 'rc': 0, 'start': '2021-02-10 ', 'stderr': '', 'delta': '0:00:00.004027', 'stdout_lines': ['host0', 'host1', 'host2'], 'stderr_lines': [], 'failed': False}&quot;
  }
  
  </code></pre>
  <p>The actual output is the python error as described above plus the error report:</p>
  <pre><code>fatal: [vm0]: FAILED! =&gt; {
      &quot;msg&quot;: &quot;Unexpected failure during module execution.&quot;,
      &quot;stdout&quot;: &quot;&quot;
  }
  </code></pre>