ansible-edda/plays/roles/system_smart/tasks/main.yml

30 lines
651 B
YAML
Raw Normal View History

2022-12-04 17:34:50 +01:00
- name: "install smartmontools"
ansible.builtin.apt:
name: "smartmontools"
- name: "smartd configuration"
ansible.builtin.copy:
2022-12-04 17:46:10 +01:00
src: "{{ smartd_conf_file_path }}"
2022-12-04 17:34:50 +01:00
dest: "/etc/smartd.conf"
mode: 0644
register: smartd_conf
- name: "enable smartmontools"
ansible.builtin.systemd:
name: "smartmontools"
enabled: true
- name: "start smartmontools"
ansible.builtin.systemd:
name: "smartmontools"
state: "started"
register: smartd_start
- name: "restart smartmontools"
ansible.builtin.systemd:
name: "smartmontools"
state: "restarted"
when:
smartd_conf.changed and
not smartd_start.changed