ansible-edda/plays/system/roles/smart/tasks/main.yml

30 lines
710 B
YAML

- name: "install smartmontools"
ansible.builtin.apt:
name: "smartmontools"
- name: "smartd configuration"
ansible.builtin.copy:
src: "{{ system_base_smartd_conf_file }}"
dest: "/etc/smartd.conf"
mode: 0644
register: system_smart_smartd_conf
- name: "enable smartmontools"
ansible.builtin.systemd:
name: "smartmontools"
enabled: true
- name: "start smartmontools"
ansible.builtin.systemd:
name: "smartmontools"
state: "started"
register: system_smart_smartd_start
- name: "restart smartmontools"
ansible.builtin.systemd:
name: "smartmontools"
state: "restarted"
when:
system_smart_smartd_conf.changed and
not system_smart_smartd_start.changed