smartd.yml 783 B

12345678910111213141516171819202122
  1. - name: Install smartmontools package
  2. action: ${ansible_pkg_mgr} pkg=smartmontools state=installed update_cache=yes
  3. when_boolean: ${with_smartd}
  4. - name: Install smartd configuration
  5. action: template dest=/etc/smartd.conf owner=root group=root mode=0644
  6. first_available_file:
  7. - smartd/smartd.{{ ansible_hostname }}.conf.j2
  8. - smartd/smartd.conf.j2
  9. notify:
  10. - Restart smartmontools
  11. when_boolean: ${with_smartd}
  12. - name: Update smartmontools default/init parameters
  13. action: template src=smartd/default.j2 dest=/etc/default/smartmontools owner=root group=root mode=0644
  14. notify:
  15. - Restart smartmontools
  16. when_boolean: ${with_smartd}
  17. - name: Ensure smartmontools is running
  18. action: service name=smartmontools state=started
  19. when_boolean: ${with_smartd}