Restart service on config file modification

This commit is contained in:
Yorick Barbanneau 2023-04-16 22:39:49 +02:00
parent f3ef615090
commit b1e86a36f6

View file

@ -22,6 +22,7 @@
lstrip_blocks: yes
trim_blocks: yes
mode: 0640
register: config_file
- name: copy Kanshi systemd service file
ansible.builtin.copy:
@ -42,3 +43,10 @@
state: started
enabled: true
when: service_file is changed and not ansible_check_mode
- name: Restart Kanshi service
ansible.builtin.systemd:
name: kanshi.service
state: restarted
scope: user
when: config_file is changed and not service_file is changed