|
---
|
|
#- debug:
|
|
# msg: "{{ access_list }}"
|
|
|
|
- name: Set public keys
|
|
become: true
|
|
become_user: "{{ item.value.username }}"
|
|
authorized_key: user="{{ item.value.username }}" key="{{ lookup('file', item.value.keypath) }}" state=present
|
|
with_dict: "{{ access_list }}"
|
|
when: access_list != None and access_list is defined
|
|
|
|
#- debug:
|
|
# msg: "{{ secret_list }}"
|
|
|
|
- name: Upload secret keys
|
|
become: true
|
|
become_user: "{{ item.value.username }}"
|
|
copy: src="{{ item.value.keypath }}" dest="~/.ssh/{{ item.value.keypath | basename }}" mode=0600
|
|
with_dict: "{{ secret_list }}"
|
|
when: secret_list != None and secret_list is defined
|
|
|