title: iteration using with_items and register
body: <p>Looking for help with a problem I've been struggling with for a few hours. I want to iterate over a list, run a command, register the output for each command and then iterate with debug over each unique registers {{ someregister }}.stdout</p>
  
  <p>For example, the following code will spit out  <strong>"msg": "1"</strong> and <strong>"msg": "2"</strong></p>
  
  <pre><code>---
  
  - hosts: localhost
    gather_facts: false
  
    vars:
      numbers:
        - name: "first"
          int: "1"
        - name: "second"
          int: "2"
  
    tasks:
  
      - name: Register output
        command: "/bin/echo {{ item.int }}"
        register: result
        with_items: "{{ numbers }}"
  
      - debug: msg={{ item.stdout }}
        with_items: "{{ result.results }}"
  </code></pre>
  
  <p>If however, I try and capture the output of a command in a register variable that is named using with_list, I am having trouble accessing the list or the elements within it. For example, altering the code slightly to:</p>
  
  <pre><code>---
  
  - hosts: localhost
    gather_facts: false
  
    vars:
      numbers:
        - name: "first"
          int: "1"
        - name: "second"
          int: "2"
  
    tasks:
  
      - name: Register output
        command: "/bin/echo {{ item.int }}"
        register: "{{ item.name }}"
        with_items: "{{ numbers }}"
  
      - debug: var={{ item.name.stdout }}
        with_items: "{{ numbers }}"
  </code></pre>
  
  <p>Gives me:</p>
  
  <pre><code>TASK [debug] 
  
  &gt; ******************************************************************* fatal: [localhost]: FAILED! =&gt; {"failed": true, "msg": "'unicode
  &gt; object' has no attribute 'stdout'"}
  </code></pre>
  
  <p>Is it not possible to dynamically name the register the output of a command which can then be called later on in the play? I would like each iteration of the command and its subsequent <strong><em>register</em></strong> name to be accessed uniquely, e.g, given the last example I would expect there to be variables registered called "first" and "second" but there aren't. </p>
  
  <p>Taking away the with_items from the debug stanza, and just explicitly defining the var or message using first.stdout returns "undefined".</p>
  
  <p>Ansible version is 2.0.2.0 on Centos 7_2.</p>
  
  <p>Thanks in advance.</p>