Add separate service and config changes handlers
This commit is contained in:
parent
64e64e6b03
commit
b6f5c6a4f1
|
@ -1,6 +1,3 @@
|
|||
- name: Reload daemon
|
||||
systemd:
|
||||
daemon_reload: true
|
||||
- name: Run service actions
|
||||
loop: "{{ systemd.services }}"
|
||||
systemd:
|
||||
|
@ -8,3 +5,9 @@
|
|||
enabled: "{% if item.enabled|default(false) %}yes{% else %}no{% endif %}"
|
||||
state: "{{ item.action }}"
|
||||
daemon_reload: "{% if item.daemon_reload|default(false) %}yes{% else %}no{% endif %}"
|
||||
- name: Restart services
|
||||
loop: "{{ systemd.services }}"
|
||||
systemd:
|
||||
name: '{{ item.name }}'
|
||||
state: "restarted"
|
||||
daemon_reload: true
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
src: "{{ item }}.service.j2"
|
||||
dest: "/etc/systemd/system/{{ item }}.service.d/override.conf"
|
||||
notify:
|
||||
- Reload daemon
|
||||
- Run service actions
|
||||
- Restart services
|
||||
when: (systemd.overrides| default([])) | length
|
||||
tags:
|
||||
- systemd
|
||||
|
|
Reference in New Issue