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
|
# 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
@@ -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"
|
||||||
|
|||||||
@@ -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 == ""
|
||||||
|
|||||||
Reference in New Issue
Block a user