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: package:
name: "{{ system_ssh_package }}" name: "{{ system_ssh_package }}"
state: present 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 - name: copy ssh config for user
become: true become: true
template: template:
dest: "/home/{{ item }}/.ssh" dest: "/home/{{ item }}/.ssh/config"
src: "ssh/config.j2" src: "ssh/config.j2"
force: true force: true
remote_src: false remote_src: false