2022-12-04 17:34:50 +01:00
|
|
|
- name: "install smartmontools"
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name: "smartmontools"
|
|
|
|
|
|
|
|
- name: "smartd configuration"
|
|
|
|
ansible.builtin.copy:
|
2022-12-08 23:19:54 +01:00
|
|
|
src: "{{ system_base_smartd_conf_file }}"
|
2022-12-04 17:34:50 +01:00
|
|
|
dest: "/etc/smartd.conf"
|
|
|
|
mode: 0644
|
2022-12-08 23:19:54 +01:00
|
|
|
register: system_smart_smartd_conf
|
2022-12-04 17:34:50 +01:00
|
|
|
|
|
|
|
- name: "enable smartmontools"
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: "smartmontools"
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
- name: "start smartmontools"
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: "smartmontools"
|
|
|
|
state: "started"
|
2022-12-08 23:19:54 +01:00
|
|
|
register: system_smart_smartd_start
|
2022-12-04 17:34:50 +01:00
|
|
|
|
|
|
|
- name: "restart smartmontools"
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: "smartmontools"
|
|
|
|
state: "restarted"
|
|
|
|
when:
|
2022-12-08 23:19:54 +01:00
|
|
|
system_smart_smartd_conf.changed and
|
|
|
|
not system_smart_smartd_start.changed
|