Copy ssh key from windows user

This commit is contained in:
Michael Mandl 2020-11-11 14:39:50 +01:00 committed by Michael Mandl
parent 9340e7415d
commit 522a9bad15
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7

View File

@ -8,3 +8,19 @@
state: present state: present
update_password: always update_password: always
register: account register: account
- name: ensure .ssh exists
become_user: "{{ account.name }}"
file:
path: "/home/{{ account.name }}/.ssh"
state: directory
mode: "0700"
- name: copy ssh key
become_user: "{{ account.name }}"
copy:
src: "{{ item }}"
dest: "/home/{{ account.name }}/.ssh/"
mode: "0600"
with_fileglob:
- "/mnt/c/Users/mandl/.ssh/id_rsa*"