- name: Install and Configure NextDNS CLI hosts: UDM become: false gather_facts: yes tasks: - name: Check if NextDNS is installed ansible.builtin.shell: apt list --installed | grep nextdns register: nextdns_status ignore_errors: True check_mode: False changed_when: False - name: Download and Install NextDNS CLI ansible.builtin.shell: cmd: "printf 'i\n{{ nextdns_profile_id }}\nY\nY\nY' | sh -c 'sh -c \"$(curl -sL https://nextdns.io/install)\"'" when: nextdns_status.stdout == ""