check if its installed

This commit is contained in:
2023-12-27 13:24:44 -05:00
parent 03ea58bb70
commit 3470709ecd
+10 -14
View File
@@ -3,18 +3,14 @@
gather_facts: yes gather_facts: yes
tasks: tasks:
- name: Download and install NextDNS CLI - name: Check if NextDNS is installed
ansible.builtin.expect: ansible.builtin.shell: apt list --installed | grep nextdns
command: sh -c 'sh -c "$(curl -sL https://nextdns.io/install)"' register: nextdns_status
responses: ignore_errors: True
Question: check_mode: False
- 'Choice (default=i):' : 'i' changed_when: False
- 'NextDNS Profile ID (default=e3448e):' : 'e3448e'
- 'Report device name? [Y|n]:' : 'Y'
- 'Enable caching? [Y|n]:' : 'Y'
- 'Enable instant refresh? (y/n):' : 'Y'
- name: Start NextDNS CLI - name: Download and Install NextDNS CLI
ansible.builtin.command: ansible.builtin.shell:
cmd: nextdns start cmd: printf "i\ne3448e\nY\nY\nY" |sh -c 'sh -c "$(curl -sL https://nextdns.io/install)"'
ignore_errors: yes when: nextdns_status.rc == 0