Skip to content

Commit

Permalink
Ensure deploy_user home directoy 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 committed Oct 24, 2023
1 parent f91e728 commit 7bae662
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 7bae662

Please sign in to comment.