Copy ssh key from windows user
This commit is contained in:
parent
9340e7415d
commit
522a9bad15
1 changed files with 16 additions and 0 deletions
|
@ -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*"
|
||||||
|
|
Loading…
Reference in a new issue