2022-09-11 20:55:30 +02:00
|
|
|
- name: Install smartmontools
|
|
|
|
apt:
|
|
|
|
name: smartmontools
|
|
|
|
|
|
|
|
- name: Smartd configuration
|
|
|
|
copy:
|
2022-09-22 23:01:27 +02:00
|
|
|
src: ./filesystem/{{ ansible_hostname }}/etc/smartd.conf
|
2022-09-11 20:55:30 +02:00
|
|
|
dest: /etc/smartd.conf
|
|
|
|
mode: 0644
|
|
|
|
register: smartd_conf
|
|
|
|
|
2022-11-03 01:06:40 +01:00
|
|
|
- name: Enable smartmontools
|
2022-09-11 20:55:30 +02:00
|
|
|
systemd:
|
|
|
|
name: smartmontools
|
|
|
|
enabled: yes
|
2022-11-03 01:06:40 +01:00
|
|
|
|
|
|
|
- name: Start smartmontools
|
|
|
|
systemd:
|
|
|
|
name: smartmontools
|
2022-09-11 20:55:30 +02:00
|
|
|
state: started
|
2022-11-03 01:06:40 +01:00
|
|
|
register: smartd_start
|
2022-09-11 20:55:30 +02:00
|
|
|
|
|
|
|
- name: Restart smartmontools
|
|
|
|
systemd:
|
|
|
|
name: smartmontools
|
|
|
|
state: restarted
|
|
|
|
when:
|
2022-11-03 01:06:40 +01:00
|
|
|
smartd_conf is changed and
|
|
|
|
smartd_start is not changed
|