Iterate through ddclient list for multiple records
This commit is contained in:
parent
9a0503b321
commit
1f26fc6b94
@ -2,11 +2,6 @@ manage_network: false
|
|||||||
network_type: static
|
network_type: static
|
||||||
allow_reboot: true
|
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:
|
packages:
|
||||||
- cryptsetup
|
- cryptsetup
|
||||||
- curl
|
- curl
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
template:
|
template:
|
||||||
src: ddclient.conf.j2
|
src: ddclient.conf.j2
|
||||||
dest: /etc/ddclient.conf
|
dest: /etc/ddclient.conf
|
||||||
register: ddclient
|
register: ddclient_settings
|
||||||
|
|
||||||
- name: Start ddclient and enable on boot
|
- name: Start ddclient and enable on boot
|
||||||
service:
|
service:
|
||||||
@ -19,4 +19,4 @@
|
|||||||
service:
|
service:
|
||||||
name: ddclient
|
name: ddclient
|
||||||
state: restarted
|
state: restarted
|
||||||
when: ddclient.changed
|
when: ddclient_settings.changed
|
||||||
|
@ -14,4 +14,4 @@
|
|||||||
|
|
||||||
- import_tasks: ddclient.yml
|
- import_tasks: ddclient.yml
|
||||||
tags: ddclient
|
tags: ddclient
|
||||||
when: ddclient_password is defined
|
when: ddclient is defined
|
||||||
|
@ -2,10 +2,17 @@
|
|||||||
#
|
#
|
||||||
# /etc/ddclient.conf
|
# /etc/ddclient.conf
|
||||||
|
|
||||||
verbose={{ ddclient_verbose }}
|
{% for domain in ddclient %}
|
||||||
use=web, web={{ ddclient_web }}
|
{% if domain.verbose is sameas true or domain.verbose is not defined %}
|
||||||
protocol={{ ddclient_protocol }}
|
verbose=yes
|
||||||
server={{ ddclient_server }}
|
{% else %}
|
||||||
login={{ ddclient_login }}
|
verbose=no
|
||||||
password={{ ddclient_password }}
|
{% endif %}
|
||||||
{{ ddclient_host }}
|
use=web, web={{ domain.web | default('dynamicdns.park-your-domain.com/getip')}}
|
||||||
|
protocol={{ domain.protocol | default('namecheap')}}
|
||||||
|
server={{ domain.server | default('dynamicdns.park-your-domain.com')}}
|
||||||
|
login={{ domain.name }}
|
||||||
|
password={{ domain.pass }}
|
||||||
|
{{ domain.host }}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user