I was trying to follow with_dic notation,
- command: echo {{ item.0.value.name }} {{ item.1 }}
with_subelements:
- users
- authorized
but then I just used directly the name property and it worked:
- command: echo {{ item.0.name }} {{ item.1 }}
with_subelements:
- users
- authorized
I apologize for wasting your time.
On Friday, September 25, 2015 at 11:57:25 AM UTC-5, Serge van Ginderachter
wrote:
>
> Can you show the task how you try that?
>
> On 25 September 2015 at 18:50, Luis Óscar Ramos Carreón <
> [email protected] <javascript:>> wrote:
>
>> Hi,
>>
>> I would like to do something like the example in Looping over Subelements
>> <http://docs.ansible.com/ansible/playbooks_loops.html#looping-over-subelements>
>> but
>> using a hash instead of a list.
>>
>> ---
>> users:
>> demo:
>> name: alice
>> authorized:
>> - /tmp/alice/onekey.pub
>> - /tmp/alice/twokey.pub
>> admin:
>> name: bob
>> authorized:
>> - /tmp/bob/id_rsa.pub
>>
>> I couldn't make it work. Is it even possible? Is there any alternative to
>> loop over a hash subelements?
>>
>> I'm using a hash because in other tasks I need to use an specific item
>> value: {{ users.demo.name }}
>>
>> Thank you for your time.
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/1c16fc38-fdd9-4d5e-854b-de9b03ad51bc%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/1c16fc38-fdd9-4d5e-854b-de9b03ad51bc%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/a5357b63-9f6b-4dfc-b5cb-96511eddbdb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.