From 2925005ab84a35fcae464726afb54e58cb14cd2b Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 6 Nov 2022 19:10:26 +0100 Subject: [PATCH] add .ssh check --- tasks/ssh.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/ssh.yml b/tasks/ssh.yml index b4ea43b..03cfffb 100644 --- a/tasks/ssh.yml +++ b/tasks/ssh.yml @@ -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