mirror of
https://github.com/Crocmagnon/ansible.git
synced 2024-12-23 22:42:02 +01:00
refactor systemd playbooks
This commit is contained in:
parent
7e5807e009
commit
1d74e9609b
4 changed files with 6 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue