homeserver/roles/mgrote.apcupsd/tasks/main.yml

31 lines
989 B
YAML
Raw Normal View History

2020-08-18 11:57:53 +02:00
- name: apcupsd installieren
apt:
name:
- apcupsd
- apcupsd-cgi
- apcupsd-doc
state: present
become: yes
notify: apc_access_mail
- name: apcupsd kopieren
become: yes
template:
src: "apcupsd"
dest: "/etc/default/apcupsd"
- name: empfaenger_mail_setzen
become: yes
lineinfile:
path: /etc/apcupsd/apccontrol #wo
regexp: export SYSADMIN=root #suche nach
line: export SYSADMIN={{ empfaenger_mail }} #ersetze durch...
backrefs: yes #verhindert das die zeile bei "nicht zutreffen" am ende der datei angefuegt wird: https://docs.ansible.com/ansible/latest/modules/lineinfile_module.html#parameters
- name: apcupsd.conf_kopieren
become: yes
template:
src: "apcupsd.conf"
dest: "/etc/apcupsd/apcupsd.conf"
notify: restart_apcupsd #benachrchtigt handlers/main.yml-restart-apcupsd_restart um den dient neuzustarten, nur wenn hier status "changed" ausgeworfen wird"