--- - name: install smartmontools apt: name: smartmontools state: present - name: make sure smartd service is stopped and masked when: (ansible_distribution == 'Debian' and (ansible_distribution_release | debian_release_compare('<', 'bullseye'))) or (ansible_distribution == 'Ubuntu' and (ansible_distribution_release | ubuntu_release_compare('<', 'focal'))) systemd: name: smartd.service state: stopped masked: yes - name: make sure smartmontools service is stopped and masked systemd: name: smartmontools.service state: stopped masked: yes - name: install the smartmon textfile collector script include_tasks: textfile_collector_generic.yml