smartd.yml 696 B

12345678910111213141516171819202122
  1. - name: Install smartmontools package
  2. apt: pkg=smartmontools state=installed update_cache=yes
  3. when: with_smartd
  4. - name: Install smartd configuration
  5. 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: with_smartd
  12. - name: Update smartmontools default/init parameters
  13. template: src=smartd/default.j2 dest=/etc/default/smartmontools owner=root group=root mode=0644
  14. notify:
  15. - Restart smartmontools
  16. when: with_smartd
  17. - name: Ensure smartmontools is running
  18. service: name=smartmontools state=started
  19. when: with_smartd