Update dynamic DNS with ddclient

This commit is contained in:
Kris Lamoureux 2021-02-28 02:26:21 -05:00
parent de1ec27aa0
commit 497572ce9d
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
4 changed files with 42 additions and 0 deletions

View File

@ -2,6 +2,11 @@ manage_network: false
network_type: static
allow_reboot: true
ddclient_web: dynamicdns.park-your-domain.com/getip
ddclient_server: dynamicdns.park-your-domain.com
ddclient_protocol: namecheap
ddclient_verbose: "yes"
packages:
- cryptsetup
- curl

View File

@ -0,0 +1,22 @@
- name: Install ddclient
apt:
name: ddclient
state: present
- name: Install ddclient settings
template:
src: ddclient.conf.j2
dest: /etc/ddclient.conf
register: ddclient
- name: Start ddclient and enable on boot
service:
name: ddclient
state: started
enabled: true
- name: Restart ddclient
service:
name: ddclient
state: restarted
when: ddclient.changed

View File

@ -11,3 +11,7 @@
- import_tasks: duckdns.yml
tags: duckdns
when: duckdns is defined
- import_tasks: ddclient.yml
tags: ddclient
when: ddclient_password is defined

View File

@ -0,0 +1,11 @@
# Configuration file for ddclient managed by Ansible
#
# /etc/ddclient.conf
verbose={{ ddclient_verbose }}
use=web, web={{ ddclient_web }}
protocol={{ ddclient_protocol }}
server={{ ddclient_server }}
login={{ ddclient_login }}
password={{ ddclient_password }}
{{ ddclient_host }}