Skip to content

Commit

Permalink
Ensure deploy_user home has the correct permissions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Senen authored and javierm committed Nov 20, 2023
1 parent 3db2c82 commit ffd6c4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions roles/user/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit ffd6c4f

Please sign in to comment.