homeserver/roles/mgrote.apcupsd/tasks/main.yml
Quotengrote 15d783de86
FQCN eingeführt (#70)
* template --> ansible.builtin.template

* apt --> ansible.builtin.apt

* lineinfile --> ansible.builtin.lineinfile

* file --> ansible.builtin.file

* blockinfile --> ansible.builtin.blockinfile

* cron --> ansible.builtin.cron

* timezone --> ansible.builtin.timezone

* get_url --> ansible.builtin.get_url

* group --> ansible.builtin.group

* user --> ansible.builtin.user

* unarchive --> ansible.builtin.unarchive

* service --> ansible.builtin.service

* apache2_module --> ansible.builtin.apache2_module

* package --> ansible.builtin.apt

* template --> ansible.builtin.template 2
2020-11-21 19:41:19 +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 #benachrchtigt handlers/main.yml-restart-apcupsd_restart um den dient neuzustarten, nur wenn hier status "changed" ausgeworfen wird"