mg
e9f78f93eb
Bugfix: acng ansible.builtin.apt --> ansible.builtin.package Co-authored-by: Michael Grote <38253905+quotengrote@users.noreply.github.com> Reviewed-on: mg/ansible#20 Co-Authored-By: mg <michael.grote@posteo.de> Co-Committed-By: mg <michael.grote@posteo.de>
30 lines
1 KiB
YAML
30 lines
1 KiB
YAML
- name: apcupsd installieren
|
|
ansible.builtin.package:
|
|
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"
|