Compare commits

..

7 Commits

Author SHA1 Message Date
jeet dd63f1c408 Fix issues 2,3: move NextDNS profile ID to variable, upgrade to ed25519 key
- inventory.yml: replace id_rsa with id_ed25519, add nextdns_profile_id host var (closes #2, #3)
- config-nextdns.yml: reference nextdns_profile_id variable, add become: false

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 14:14:14 -04:00
jeet 42f0f85169 Clean up readme 2023-12-27 13:47:00 -05:00
jeet 5089ab3e90 Remove extra space 2023-12-27 13:46:11 -05:00
jeet c8cc541980 Fix readme 2023-12-27 13:45:59 -05:00
jeet 5b5cc7ba92 Update Readme 2023-12-27 13:45:29 -05:00
jeet 124ed3f118 fix check and install script 2023-12-27 13:33:01 -05:00
jeet 3470709ecd check if its installed 2023-12-27 13:24:44 -05:00
3 changed files with 29 additions and 18 deletions
+16 -3
View File
@@ -1,10 +1,10 @@
# Unifi-NextDNS: Automated with Ansible # Unifi-NextDNS: Automated with Ansible
This repo servers to install/reinstall NextDNS CLI on the UDMP This repo serves to install/reinstall NextDNS CLI on UnifiOS.
### Pre Requisites ### Pre Requisites
SSH key based authentication must be setup to the UDM. SSH key based authentication must be setup to the Unifi device.
### To Use These Playbooks ### To Use These Playbooks
@@ -17,7 +17,20 @@ Simply clone this repository and follow the readme below.
├── inventory.yml ├── inventory.yml
└── playbooks └── playbooks
├── config-nextdns.yml ├── config-nextdns.yml
`````` ``````
## Introduction
This repo has been built to streamline installing or reinstalling NextDNS CLI after Unifi OS upgrades.
To get started, clone the github repo that goes along with this post:
`git clone https://madereddy.com/git/jeet/Unifi-NextDNS.git`
`cd Unifi-NextDNS`
## Usage
To install/reinstall NextDNS CLI you will use the config-nextdns.yml playbook.
`ansible-playbook playbooks/config-nextdns.yml`
+2 -1
View File
@@ -5,4 +5,5 @@ all:
UDMP: UDMP:
ansible_host: 192.168.1.1 ansible_host: 192.168.1.1
ansible_user: root ansible_user: root
ansible_ssh_private_key_file: ~/.ssh/id_rsa ansible_ssh_private_key_file: ~/.ssh/id_ed25519
nextdns_profile_id: "e3448e"
+11 -14
View File
@@ -1,20 +1,17 @@
- name: Install and Configure NextDNS CLI - name: Install and Configure NextDNS CLI
hosts: UDM hosts: UDM
become: false
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\n{{ nextdns_profile_id }}\nY\nY\nY' | sh -c 'sh -c \"$(curl -sL https://nextdns.io/install)\"'"
ignore_errors: yes when: nextdns_status.stdout == ""