Compare commits

...

9 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
jeet 03ea58bb70 Update expect 2023-12-27 11:50:47 -05:00
jeet b6c4de3f76 Fix formating 2023-12-27 11:45:05 -05:00
3 changed files with 29 additions and 19 deletions
+16 -3
View File
@@ -1,10 +1,10 @@
# 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
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
@@ -17,7 +17,20 @@ Simply clone this repository and follow the readme below.
├── inventory.yml
└── playbooks
├── 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:
ansible_host: 192.168.1.1
ansible_user: root
ansible_ssh_private_key_file: ~/.ssh/id_rsa
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
nextdns_profile_id: "e3448e"
+11 -15
View File
@@ -1,21 +1,17 @@
---
- name: Install and Configure NextDNS CLI
hosts: UDM
become: false
gather_facts: yes
tasks:
- name: Download and install NextDNS CLI
ansible.builtin.expect:
command: sh -c 'sh -c "$(curl -sL https://nextdns.io/install)"'
responses:
Question:
- i
- e3448e
- Y
- Y
- Y
- 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: Start NextDNS CLI
ansible.builtin.command:
cmd: nextdns start
ignore_errors: yes
- 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 == ""