2022-12-04 17:29:43 +01:00
|
|
|
- name: "install acpupsd"
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name: "apcupsd"
|
|
|
|
|
|
|
|
- name: "apcupsd configuration"
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "./apcupsd.conf"
|
|
|
|
dest: "/etc/apcupsd/apcupsd.conf"
|
|
|
|
mode: 0644
|
|
|
|
register: apcupsd_conf
|
|
|
|
|
|
|
|
- name: "enable apcupsd"
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: "apcupsd"
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
- name: "start apcupsd"
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: "apcupsd"
|
|
|
|
state: "started"
|
|
|
|
register: apcupsd_start
|
|
|
|
|
|
|
|
- name: "restart apcupsd"
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: "apcupsd"
|
|
|
|
state: "restarted"
|
|
|
|
when:
|
2022-12-04 17:34:50 +01:00
|
|
|
apcupsd_conf.changed and
|
|
|
|
not apcupsd_start.changed
|