Restart service on config file modification

This commit is contained in:
Yorick Barbanneau 2023-04-16 22:44:54 +02:00
parent a009e377d0
commit cc223138e4

View file

@ -22,6 +22,7 @@
lstrip_blocks: yes
trim_blocks: yes
mode: 0640
register: config_file
- name: copy Swayidle 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 Swayidle service
ansible.builtin.systemd:
name: swayidle.service
state: restarted
scope: user
when: config_file is changed and not service_file is changed