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
|
- name: Run service actions
|
||||||
loop: "{{ systemd.services }}"
|
loop: "{{ systemd.services }}"
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -8,3 +5,9 @@
|
||||||
enabled: "{% if item.enabled|default(false) %}yes{% else %}no{% endif %}"
|
enabled: "{% if item.enabled|default(false) %}yes{% else %}no{% endif %}"
|
||||||
state: "{{ item.action }}"
|
state: "{{ item.action }}"
|
||||||
daemon_reload: "{% if item.daemon_reload|default(false) %}yes{% else %}no{% endif %}"
|
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"
|
src: "{{ item }}.service.j2"
|
||||||
dest: "/etc/systemd/system/{{ item }}.service.d/override.conf"
|
dest: "/etc/systemd/system/{{ item }}.service.d/override.conf"
|
||||||
notify:
|
notify:
|
||||||
- Reload daemon
|
- Restart services
|
||||||
- Run service actions
|
|
||||||
when: (systemd.overrides| default([])) | length
|
when: (systemd.overrides| default([])) | length
|
||||||
tags:
|
tags:
|
||||||
- systemd
|
- systemd
|
||||||
|
|
Reference in New Issue