- name: Install acpupsd apt: name: apcupsd - name: Apcupsd configuration copy: src: ./filesystem/{{ ansible_hostname }}/etc/apcupsd/apcupsd.conf dest: /etc/apcupsd/apcupsd.conf mode: 0644 register: apcupsd_conf - name: Enable/start apcupsd systemd: name: apcupsd enabled: yes state: started - name: Restart apcupsd systemd: name: apcupsd state: restarted when: apcupsd_conf is changed