Update dynamic DNS with ddclient
This commit is contained in:
parent
de1ec27aa0
commit
497572ce9d
@ -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
|
||||
|
22
roles/base/tasks/ddclient.yml
Normal file
22
roles/base/tasks/ddclient.yml
Normal 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
|
@ -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
|
||||
|
11
roles/base/templates/ddclient.conf.j2
Normal file
11
roles/base/templates/ddclient.conf.j2
Normal 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 }}
|
Loading…
Reference in New Issue
Block a user