Found solution in Doc:

- user: name={{ item.name }} state=present generate_ssh_key=yes
  with_items: "{{users}}"

- authorized_key: "user={{ item.0.name }} key='{{ lookup('file', item.1) }}'"
  with_subelements:
     - users
     - authorized

And somewhere define:

users:

- name: test1
    authorized:
      - "{{ user1_key }}"
      - "{{ user2_key }}"


But, when I decide to remove user2_key, It still persists in authorized_key 
file! It's unacceptable!


-- 
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/340284fc-afb9-4298-ae11-a3a804cee1d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to