infra/roles/hypervisor/tasks/ups.yaml

28 lines
762 B
YAML
Raw Permalink Normal View History

2024-08-05 07:05:54 +00:00
- name: Install apcupsd
apt:
name: apcupsd
- name: download apcupsd_exporter
get_url:
url: https://git.janky.solutions/api/packages/JankySolutions/generic/infra-apcupsd_exporter/4c09b127c353cd57e6bc369f510fe516a0f65c0d/apcupsd_exporter
checksum: sha256:b17cc67d8ea9c6f1494b581a57a2315e33abf6dfb8edf2e1c14a50a0fb85e768
dest: /usr/local/bin/apcupsd_exporter
mode: "0755"
notify:
- restart apcupsd_exporter
- name: install apcupsd_exporter service
template:
src: apcupsd_exporter.service
dest: /etc/systemd/system/apcupsd_exporter.service
notify:
- systemctl daemon-reload
- restart apcupsd_exporter
- meta: flush_handlers
- name: enable apcupsd_exporter
service:
name: apcupsd_exporter
enabled: true