smartd.yml 584 Bytes
Newer Older
1 2 3 4 5
---
- name: install smartd
  become: yes
  package:
    name: smartmontools
julian.gethmann's avatar
julian.gethmann committed
6
    state: present
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
  notify:
    - enable smartd
    - restart smartd

- name: configure smartd on Fedora/CentOS
  become: yes
  lineinfile:
    line: "DEVICESCAN -H -m {{ admin_mail }} -M exec /usr/libexec/smartmontools/smartdnotify -n standby,10,q -s (S/../.././02|L/../../6/03) -W 4,35,40"
    regexp: ^DEVICESCAN .*$
    backup: yes
    path: /etc/smartmontools/smartd.conf
  notify:
    - enable smartd
    - restart smartd
  when: (ansible_distribution == "Fedora" or ansible_distribution == "CentOS")