when using with_dict, item.key retrieves the dict key and item.value
retrieves the value.
however, when using with_subelements and having the first item being looped
over be a dict, item.0 seems to return only the value. Is there a way
concrete example:
vars:
users:
bob:
authorized_keys:
- "ssh-rsa a..."
- "ssh-rsa b..."
alice:
authorized_keys:
- "ssh-rsa c..."
tasks:
- authorized_key: user=??? key="{{ item.1 }}"
with_subelements:
- "{{ users }}"
- authorized_keys
How do I retrieve the username? I understand that I could change users into
a list and add username as a property. I want to avoid that because this
users list is used for lots of different things where being able to look up
information about a user by username is required.
--
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/c2173c35-e3be-4096-930b-21d8d3e8a9e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.