homeserver/roles/mgrote.apcupsd/tasks/main.yml
Quotengrote 61fee4af86
apcupsd (#83)
* apsupsd: Parameter NOLOGON eingebaut

* Typo

* Housekeeping
2020-12-07 09:31:17 +01:00

30 lines
1 KiB
YAML

- name: apcupsd installieren
ansible.builtin.apt:
name:
- apcupsd
- apcupsd-cgi
- apcupsd-doc
state: present
become: yes
notify: apc_access_mail
- name: apcupsd kopieren
become: yes
ansible.builtin.template:
src: "apcupsd"
dest: "/etc/default/apcupsd"
- name: empfaenger_mail_setzen
become: yes
ansible.builtin.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
ansible.builtin.template:
src: "apcupsd.conf"
dest: "/etc/apcupsd/apcupsd.conf"
notify: restart_apcupsd #benachrichtigt handlers/main.yml-restart-apcupsd_restart um den dient neuzustarten, nur wenn hier status "changed" ausgeworfen wird"