Pfade smartctl angepasst

This commit is contained in:
Michael Grote 2021-02-14 10:43:53 +01:00
parent b4a98f3c96
commit 1b5c28dad5
2 changed files with 54 additions and 8 deletions

View file

@ -0,0 +1,52 @@
---
- hosts: proxmox
become: yes
tasks:
- name: smartmontools kopieren
become: yes
ansible.builtin.file:
path: "/etc/default/smartmontools"
state: absent
- name: smartd.conf kopieren
become: yes
ansible.builtin.file:
path: "/etc/smartd.conf"
state: absent
- name: smartctl_mail.sh kopieren
become: yes
ansible.builtin.file:
path: "/usr/local/bin/smartctl_mail.sh"
state: absent
- name: smart_status.sh kopieren
become: yes
ansible.builtin.file:
path: "/usr/local/bin/smart_status.sh"
state: absent
# smartctl output als mail
- name: cronjob fuer smartctl-mail
become: yes
ansible.builtin.cron:
name: smart-mail
state: absent
job: "/usr/local/bin/smartctl_mail.sh"
minute: "{{ smart_smartctlmail_cron_minutes }}"
hour: "{{ smart_smartctlmail_cron_hours }}"
weekday: "{{ smart_smartctlmail_cron_weekday }}"
- name: smartctl_mail.sh kopieren
become: yes
ansible.builtin.file:
path: "/root/smart/smartctl_mail.sh"
state: absent
- name: smartctl_mail.sh kopieren
become: yes
ansible.builtin.file:
path: "/root/smart/"
state: absent

View file

@ -19,17 +19,11 @@
dest: "/etc/smartd.conf" dest: "/etc/smartd.conf"
notify: smartmontools_starten_aktivieren notify: smartmontools_starten_aktivieren
- name: Ordner "smart" erstellen
become: yes
ansible.builtin.file:
path: "/root/smart"
state: directory
- name: smartctl_mail.sh kopieren - name: smartctl_mail.sh kopieren
become: yes become: yes
ansible.builtin.template: ansible.builtin.template:
src: "smartctl_mail.sh" src: "smartctl_mail.sh"
dest: "/root/smart/smartctl_mail.sh" dest: "/usr/local/bin/smartctl_mail.sh"
mode: a+x mode: a+x
- name: smart_status.sh kopieren - name: smart_status.sh kopieren
@ -45,7 +39,7 @@
ansible.builtin.cron: ansible.builtin.cron:
name: smart-mail name: smart-mail
state: present state: present
job: "/root/smart/smartctl_mail.sh" job: "/usr/local/bin/smartctl_mail.sh"
minute: "{{ smart_smartctlmail_cron_minutes }}" minute: "{{ smart_smartctlmail_cron_minutes }}"
hour: "{{ smart_smartctlmail_cron_hours }}" hour: "{{ smart_smartctlmail_cron_hours }}"
weekday: "{{ smart_smartctlmail_cron_weekday }}" weekday: "{{ smart_smartctlmail_cron_weekday }}"