add .ssh check

This commit is contained in:
vincent 2022-11-06 19:10:26 +01:00
parent 1575a24766
commit 2925005ab8

View File

@ -3,10 +3,20 @@
package:
name: "{{ system_ssh_package }}"
state: present
- name: ensure .ssh exist for user
become: true
file:
state: directory
path: "/home/{{item}}/.ssh"
owner: "{{item}}"
mode: 0700
with_items:
- "{{user.name}}"
- name: copy ssh config for user
become: true
template:
dest: "/home/{{ item }}/.ssh"
dest: "/home/{{ item }}/.ssh/config"
src: "ssh/config.j2"
force: true
remote_src: false