From 96e0eb3884c35198d9975e456efbcbb005e45333 Mon Sep 17 00:00:00 2001 From: Opnxng Date: Wed, 15 Nov 2023 03:08:19 +0800 Subject: [PATCH] Added task to set SSH key permission --- tasks/main.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/main.yaml b/tasks/main.yaml index 26fb143..48836c9 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -41,3 +41,10 @@ manage_dir: '{{ should_manage_dir }}' key: "{{ ssh_deployment_key }}" +- name: Set ownership and permissions for SSH private key + ansible.builtin.file: + path: '/home/{{ ssh_host_user }}/{{ ssh_key_path }}' + owner: 1000 + group: 1000 + mode: 0600 + delegate_to: localhost