On Friday, 23 March 2018 20.24.52 CET Dayton Jones wrote:
> Yes, that's what I've been trying - just failing. I've tried
> "with_subelements" "with_nested" even attempted something like:
> key: |
> {% for name, keys in public_ssh_keys if name in ssh_users %}
> ...
>
>
> But haven't hit it yet...
I don't use dict that much, I try to avoid them and use list instead so look at
this as pseudocode since it like has some errors, but I think you get the idea.
- include_tasks: include.yml
with_dict: '{{ public_ssh_keys }}'
loop_control:
loop_var: outer
include.yml
---
- name: Accept public keys for Users
become: yes
authorized_key:
state: present
user: '{{ outer.key }}'
manage_dir: yes
exclusive: yes
key: '{{ item }}'
with_items: '{{ outer.value }}'
--
Kai Stian Olstad
--
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/4805968.X2tiq1RfpL%40x1.
For more options, visit https://groups.google.com/d/optout.