--- - name: smartd - install smartmontools package: name=smartmontools - name: smartd - /etc/default/smartmontools replace: path: /etc/default/smartmontools regexp: "^#start_smartd=.*" replace: "start_smartd=yes" notify: restart smartd - name: smartd - /etc/smartd.conf copy: dest: /etc/smartd.conf content: "DEVICESCAN -a -d nvme -d sat -o on -s (S/../.././01) -n standby -R 5 -I 9 -R 194 -m root -M exec /usr/share/smartmontools/smartd-runner\n" notify: restart smartd