From f289b712cd2c3e5f460d80e967c99591258fae9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= <15726+Senen@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:17:31 +0200 Subject: [PATCH] Ensure deploy_user home has the correct permissions For some reason I do not know yet, when running the installer on a Ubuntu 22.04 server it creates the deploy_user home directory with 750 permissions instead of 755. We need 755 permissions so other users like `www-data`, which runs the nginx service can read from the Consul Democracy puma socket. Otherwise we get a 502 Bad Gateway error when accessing the application. --- roles/user/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/user/tasks/main.yml b/roles/user/tasks/main.yml index afd752ce..220a9fa8 100644 --- a/roles/user/tasks/main.yml +++ b/roles/user/tasks/main.yml @@ -18,6 +18,14 @@ state: present shell: /bin/bash +- name: Ensure correct permissions of deploy user home directory + file: + path: "{{ home_dir }}" + owner: "{{ deploy_user }}" + group: "{{ deploy_group }}" + mode: 0755 + state: directory + - name: Install SSH key authorized_key: user: "{{ deploy_user }}"