Skip to content
Snippets Groups Projects
Commit 6530caab authored by ale's avatar ale
Browse files

Set up smartmontools

Since we've added SMART alerts, we should install smartd as well.
As most testing happens in VMs, the SMART functionality will only
be enabled when testing==False.
parent 51c071d3
No related branches found
No related tags found
No related merge requests found
Pipeline #84639 passed
......@@ -50,6 +50,11 @@
name: osqueryd.service
state: restarted
- name: restart smartd
systemd:
name: smartd.service
state: restarted
- name: reload firewall
systemd:
name: firewall.service
......
......@@ -94,6 +94,9 @@
- include_tasks: ipmi.yml
when: ipmi_device.stat.exists == true
- include_tasks: smart.yml
when: "not (testing | default(True))"
- include_tasks: systemd.yml
# Finally run some cleanups.
......
---
- name: Install smartmontools
apt:
name: smartmontools
state: present
- name: Configure smartd
template:
src: smartd.conf.j2
dest: /etc/smartd.conf
notify: restart smartd
- name: Disable smartd emails
file:
path: /etc/smartmontools/run.d/10mail
state: absent
# Long tests once a month, on the 15th at 15.00
# Short tests every Monday at 11.00
DEFAULT -a -s (L/../15/./15|S/../../1/11) -m {{ alert_email | default('root') }} -M exec /usr/share/smartmontools/smartd-runner
# Host specific configuration
{{ smartd_extra_config | default('') }}
DEVICESCAN {{ '-d nvme' if 'nvme0n1' in ansible_devices else '' }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment