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
vars:
users:
bob:
name: bob
authorized_keys:
- "ssh-rsa a..."
- "ssh-rsa b..."
alice:
name: alice
authorized_keys:
- "ssh-rsa c..."
tasks:
- authorized_key: user=item.0.name key="{{ item.1 }}"
with_subelements:
- "{{ users }}"
- authorized_keys
--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/6J6Yg--7CvA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/51dfa4f3-d582-4043-945b-0eb094495ec0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
users:
ssh_keys:
- somekeyfdsfdsfdsfsdfsdyttytry
- someotherkeyfdsryekfdlmgdfm
- include: ssh_key.yml
_users_ssh_keys={{item.value.ssh_keys}}
_users_username={{item.key}}
with_dict: "{{users}}"
---
- name: SSH key is installed
authorized_key: user="{{_users_username}}" key="{{_ssh_key_item}}"
loop_control:
loop_var: _ssh_key_item
with_items: "{{_users_ssh_keys}}"