I tried something like this, but it doesn't work:

- name: loop over items
  shell: cat /path/{{ item }}
  with_items:
    - t1
    - t2
    - t3
  register: output

Then I can do something like:

- name: use the result hashtable
  shell: echo /path/{{ output.results[loop.index0].stdout }}
  with_items:
    - t1
    - t2
    - t3

loop doesn't seem to work in the task file..

On Friday, December 6, 2013 3:15:31 PM UTC-5, Xu Chen wrote:
>
> I am interested in doing something like this:
>
> - name: loop over items
>   shell: cat /path/{{ item }}
>   with_items:
>     - t1
>     - t2
>     - t3
>   register: result[{{ item }}]
>
> Then I can do something like:
>
> - name: use the result hashtable
>   shell: echo /path/{{ result[item].stdout }}
>   with_items:
>     - t1
>     - t2
>
> Is this possible? Thanks..
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to