ansible-edda/playbooks/tasks/hosts/ups.yml

30 lines
549 B
YAML
Raw Normal View History

2022-09-11 20:55:30 +02:00
- name: Install acpupsd
apt:
name: apcupsd
- name: Apcupsd configuration
copy:
2022-09-22 23:01:27 +02:00
src: ./filesystem/{{ ansible_hostname }}/etc/apcupsd/apcupsd.conf
2022-09-11 20:55:30 +02:00
dest: /etc/apcupsd/apcupsd.conf
mode: 0644
register: apcupsd_conf
- name: Enable apcupsd
2022-09-11 20:55:30 +02:00
systemd:
name: apcupsd
enabled: yes
- name: Start apcupsd
systemd:
name: apcupsd
2022-09-11 20:55:30 +02:00
state: started
register: apcupsd_start
2022-09-11 20:55:30 +02:00
- name: Restart apcupsd
systemd:
name: apcupsd
state: restarted
when:
apcupsd_conf is changed and
apcupsd_start is not changed