Skip to content

Commit

Permalink
Test 5
Browse files Browse the repository at this point in the history
  • Loading branch information
javierm committed Oct 16, 2023
1 parent b91b598 commit 1255d7f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion roles/puma/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,29 @@
- name: Copy Puma service file to the systemd folder
template:
src: "{{ playbook_dir }}/roles/puma/templates/puma.service"
dest: "{{ home_dir }}/.config/systemd/user/puma.service"
dest: "{{ home_dir }}/.config/systemd/user/{{ puma_service_unit_name }}"

- name: Check if user is lingering
stat:
path: "/var/lib/systemd/linger/{{ deploy_user }}"
register: user_lingering

- name: Enable lingering is needed
command: "loginctl enable-linger {{ deploy_user }}"
when: not user_lingering.stat.exists

- name: Get user UID
shell: "id -u"
register: current_uid

- name: Start puma
systemd:
name: "{{ puma_service_unit_name }}"
enabled: true
state: started
scope: user
environment:
XDG_RUNTIME_DIR: "/run/user/{{ current_uid.stdout }}"

- name: Make sure Nginx has write access to the puma socket
shell: "chmod o+w tmp/sockets/*"
Expand Down

0 comments on commit 1255d7f

Please sign in to comment.