2022-04-26 19:53:59 +00:00
|
|
|
---
|
|
|
|
- name: Copy SSH keys
|
|
|
|
copy:
|
|
|
|
content: "{{ ssh_key_item.value }}"
|
|
|
|
dest: "{{ ansible_user_dir }}/.ssh/{{ ssh_key_item.key }}"
|
|
|
|
mode: 0400
|
|
|
|
loop_control:
|
|
|
|
loop_var: ssh_key_item
|
|
|
|
no_log: true
|
|
|
|
with_items: "{{ ssh_key | default({}) | dict2items }}"
|
2022-04-26 22:40:27 +00:00
|
|
|
|
|
|
|
- name: Create SSH configuration file
|
|
|
|
ansible.builtin.copy:
|
|
|
|
content: "{{ ssh_config }}"
|
|
|
|
dest: "{{ ansible_user_dir }}/.ssh/config"
|
|
|
|
mode: 0400
|
|
|
|
no_log: true
|
|
|
|
when: ssh_config is defined
|