- name: Install smartmontools package apt: pkg=smartmontools state=installed update_cache=yes when: with_smartd - name: Install smartd configuration template: src=smartd/smartd.conf.j2 dest=/etc/smartd.conf owner=root group=root mode=0644 notify: - Restart smartmontools when: with_smartd - name: Update smartmontools default/init parameters template: src=smartd/default.j2 dest=/etc/default/smartmontools owner=root group=root mode=0644 notify: - Restart smartmontools when: with_smartd - name: Ensure smartmontools is running service: name=smartmontools state=started when: with_smartd