-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b4755c
commit f0965e6
Showing
5 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,10 @@ | |
tags: | ||
- dashy | ||
|
||
- role: ddns_updater | ||
tags: | ||
- ddns_updater | ||
|
||
- role: deluge | ||
tags: | ||
- deluge | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
ddns_updater_enabled: false | ||
ddns_updater_available_externally: "false" | ||
|
||
# directories | ||
ddns_updater_data_directory: "{{ docker_home }}/ddns_updater" | ||
|
||
# network | ||
ddns_updater_port: 8202 | ||
ddns_updater_hostname: "ddns-updater" | ||
|
||
# docker | ||
ddns_updater_container_name: ddns_updater | ||
|
||
# specs | ||
ddns_updater_memory: 1g | ||
|
||
# gotify | ||
# ddns_updater_gotify_token: "token" | ||
# gotify_url: "https://gotify.{{ ansible_nas_domain }}" | ||
|
||
# DDNS Updater Config | ||
# Period of IP address check | ||
ddns_updater_period: 5m | ||
|
||
# Duration to cooldown between updates for each record. This is useful to avoid being rate limited or banned. | ||
ddns_updater_cooldown_period: 5m | ||
|
||
# Timeout for all HTTP requests | ||
ddns_updater_http_timeout: 10s | ||
|
||
# ddns_updater_config describes the content of the config.json used to configure the updater. | ||
# see https://github.com/qdm12/ddns-updater#configuration for more info | ||
# | ||
# ddns_updater_config: | ||
# settings: | ||
# - provider: namecheap | ||
# domain: example.com | ||
# host: "@" | ||
# password: e5322165c1d74692bfa6d807100c0310 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
- name: Start DDNS Updater | ||
block: | ||
- name: Create DDNS Updater Directories | ||
ansible.builtin.file: | ||
path: "{{ ddns_updater_data_directory }}" | ||
state: directory | ||
|
||
- name: Check config is defined | ||
ansible.builtin.fail: | ||
msg: "Please configure DDNS Updater by setting ddns_updater_config in your inventory nas.yml." | ||
when: ddns_updater_config is not defined | ||
|
||
- name: Generate config.json | ||
ansible.builtin.copy: | ||
content: "{{ ddns_updater_config | to_nice_json }}" | ||
dest: "{{ ddns_updater_data_directory }}/config.json" | ||
register: ddns_updater_config | ||
|
||
- name: DDNS Updater Container | ||
community.docker.docker_container: | ||
name: "{{ ddns_updater_container_name }}" | ||
image: qmcgaw/ddns-updater:latest | ||
pull: true | ||
ports: | ||
- "{{ ddns_updater_port }}:8000" | ||
volumes: | ||
- "{{ ddns_updater_data_directory }}:/updater/data:rw" | ||
env: | ||
TZ: "{{ ansible_nas_timezone }}" | ||
GOTIFY_TOKEN: "{{ ddns_updater_gotify_token | default('') }}" | ||
GOTIFY_URL: "{{ gotify_url | default('') }}" | ||
PERIOD: "{{ ddns_updater_period }}" | ||
UPDATE_COOLDOWN_PERIOD: "{{ ddns_updater_cooldown_period }}" | ||
HTTP_TIMEOUT: "{{ ddns_updater_http_timeout }}" | ||
restart_policy: unless-stopped | ||
restart: "{{ ddns_updater_config is changed }}" | ||
memory: "{{ ddns_updater_memory }}" | ||
labels: | ||
traefik.enable: "{{ ddns_updater_available_externally }}" | ||
traefik.http.routers.airsonic.rule: "Host(`{{ ddns_updater_hostname }}.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.airsonic.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.airsonic.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.airsonic.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.airsonic.loadbalancer.server.port: "8000" | ||
when: ddns_updater_enabled is true | ||
|
||
- name: Stop DDNS Updater | ||
block: | ||
- name: Stop DDNS Updater | ||
community.docker.docker_container: | ||
name: "{{ ddns_updater_container_name }}" | ||
state: absent | ||
when: ddns_updater_enabled is false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: "DDNS Updater" | ||
--- | ||
|
||
Lightweight universal DDNS Updater with a web UI. | ||
|
||
Homepage: [https://github.com/qdm12/ddns-updater](https://github.com/qdm12/ddns-updater) | ||
|
||
Light container updating DNS A and/or AAAA records periodically for multiple DNS providers. | ||
|
||
## Usage | ||
|
||
Set `ddns_updater_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
## Specific Configuration | ||
|
||
Ensure that the `ddns_updater_config` variable is set with your DDNS Updater configuration. The configuration is converted from YAML into JSON, required by the DDNS Updater application. Use [json2yaml](https://www.json2yaml.com/) to check your configuration format. | ||
|
||
|
||
The following configuration: | ||
|
||
```yaml | ||
ddns_updater_config: | ||
settings: | ||
- provider: namecheap | ||
domain: example.com | ||
host: "@" | ||
password: e5322165c1d74692bfa6d807100c0310 | ||
``` | ||
...will be serialised to: | ||
```json | ||
{ | ||
"settings": [ | ||
{ | ||
"provider": "namecheap", | ||
"domain": "example.com", | ||
"host": "@", | ||
"password": "e5322165c1d74692bfa6d807100c0310" | ||
} | ||
] | ||
} | ||
``` |