Compare commits
7 Commits
03ea58bb70
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| dd63f1c408 | |||
| 42f0f85169 | |||
| 5089ab3e90 | |||
| c8cc541980 | |||
| 5b5cc7ba92 | |||
| 124ed3f118 | |||
| 3470709ecd |
@@ -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
@@ -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"
|
||||
|
||||
@@ -1,20 +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:
|
||||
- 'Choice (default=i):' : 'i'
|
||||
- 'NextDNS Profile ID (default=e3448e):' : 'e3448e'
|
||||
- 'Report device name? [Y|n]:' : 'Y'
|
||||
- 'Enable caching? [Y|n]:' : 'Y'
|
||||
- 'Enable instant refresh? (y/n):' : '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 == ""
|
||||
|
||||
Reference in New Issue
Block a user