--- - name: Ensure restic is installed block: - name: Ensure restic is installed via apt apt: package: restic state: latest when: ansible_os_family == 'Debian' - name: Ensure restic is installed via dnf dnf: name: restic state: latest when: ansible_os_family == 'RedHat' - name: Ensure restic is installed using the auto-detected package-manager package: name: "{{ restic_package_name }}" state: present when: ansible_os_family not in ['RedHat', 'Debian']