refactor systemd playbooks

This commit is contained in:
Gabriel Augendre 2024-10-17 17:32:09 +02:00
parent 7e5807e009
commit 1d74e9609b
4 changed files with 6 additions and 14 deletions

View file

@ -33,13 +33,12 @@
- name: Write service unit file
become: true
ansible.builtin.template:
src: templates/goatcounter.service.j2
src: templates/goatcounter/goatcounter.service.j2
dest: /etc/systemd/system/goatcounter.service
mode: "0600"
owner: root
group: root
notify:
- Daemon-reload
- Restart service
- name: Flush handlers
ansible.builtin.meta: flush_handlers
@ -51,15 +50,12 @@
enabled: true
handlers:
- name: Daemon-reload
become: true
ansible.builtin.systemd:
daemon_reload: true
- name: Restart service
become: true
ansible.builtin.service:
ansible.builtin.systemd:
name: goatcounter
state: restarted
daemon_reload: true
vars:
ansible_python_interpreter: /tmp/ansible/bin/python

View file

@ -6,13 +6,12 @@
- name: Write service file
become: true
ansible.builtin.template:
src: templates/lyon-transports.service.j2
src: templates/lyon-transports/lyon-transports.service.j2
dest: /etc/systemd/system/lyon-transports.service
mode: "0600"
owner: root
group: root
notify:
- Reload daemon
- Restart service
- name: Flush handlers
ansible.builtin.meta: flush_handlers
@ -24,15 +23,12 @@
enabled: true
handlers:
- name: Reload daemon
become: true
ansible.builtin.systemd:
daemon_reload: true
- name: Restart service
become: true
ansible.builtin.service:
ansible.builtin.systemd:
name: lyon-transports
state: restarted
daemon_reload: true
vars:
dir: /mnt/data/lyon-transports