From 1b5c28dad57a057c222bc3390d32477129cf7992 Mon Sep 17 00:00:00 2001 From: mg Date: Sun, 14 Feb 2021 10:43:53 +0100 Subject: [PATCH] Pfade smartctl angepasst --- playbooks/on-off/remove_smart.yml | 52 +++++++++++++++++++++++++++++++ roles/mgrote.smart/tasks/main.yml | 10 ++---- 2 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 playbooks/on-off/remove_smart.yml diff --git a/playbooks/on-off/remove_smart.yml b/playbooks/on-off/remove_smart.yml new file mode 100644 index 00000000..545fd068 --- /dev/null +++ b/playbooks/on-off/remove_smart.yml @@ -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 diff --git a/roles/mgrote.smart/tasks/main.yml b/roles/mgrote.smart/tasks/main.yml index 90096903..cceef28e 100644 --- a/roles/mgrote.smart/tasks/main.yml +++ b/roles/mgrote.smart/tasks/main.yml @@ -19,17 +19,11 @@ dest: "/etc/smartd.conf" notify: smartmontools_starten_aktivieren - - name: Ordner "smart" erstellen - become: yes - ansible.builtin.file: - path: "/root/smart" - state: directory - - name: smartctl_mail.sh kopieren become: yes ansible.builtin.template: src: "smartctl_mail.sh" - dest: "/root/smart/smartctl_mail.sh" + dest: "/usr/local/bin/smartctl_mail.sh" mode: a+x - name: smart_status.sh kopieren @@ -45,7 +39,7 @@ ansible.builtin.cron: name: smart-mail state: present - job: "/root/smart/smartctl_mail.sh" + job: "/usr/local/bin/smartctl_mail.sh" minute: "{{ smart_smartctlmail_cron_minutes }}" hour: "{{ smart_smartctlmail_cron_hours }}" weekday: "{{ smart_smartctlmail_cron_weekday }}"