fix: ntfy

This commit is contained in:
Clément Désiles
2026-04-11 22:52:29 +02:00
parent 4d60c6ea34
commit c4136ba5d2
+15 -1
View File
@@ -79,9 +79,17 @@
mode: "0644" mode: "0644"
notify: Reload systemd user notify: Reload systemd user
- name: Check if lingering is enabled for {{ ansible_user }}
ansible.builtin.stat:
path: "/var/lib/systemd/linger/{{ ansible_user }}"
register: linger_file
- name: Enable lingering for user {{ ansible_user }} - name: Enable lingering for user {{ ansible_user }}
ansible.builtin.command: "loginctl enable-linger {{ ansible_user }}" ansible.builtin.command: "loginctl enable-linger {{ ansible_user }}"
when: ansible_user != 'root' changed_when: true
when:
- ansible_user != 'root'
- not linger_file.stat.exists
- name: Enable and start ntfy service (user scope) - name: Enable and start ntfy service (user scope)
ansible.builtin.systemd: ansible.builtin.systemd:
@@ -126,6 +134,12 @@
become: false become: false
become_user: "{{ ansible_user }}" become_user: "{{ ansible_user }}"
- name: Provision TLS certificate for ntfy
ansible.builtin.include_tasks: "{{ role_path }}/../nginx/tasks/certbot.yml"
vars:
certbot_hostname: "{{ ntfy_nginx_hostname }}"
when: ntfy_nginx_enabled
- name: Deploy nginx vhost configuration for ntfy - name: Deploy nginx vhost configuration for ntfy
ansible.builtin.template: ansible.builtin.template:
src: nginx-vhost.conf.j2 src: nginx-vhost.conf.j2