2019-10-06 20:55:56 +00:00
|
|
|
---
|
|
|
|
# Server/Dyndns: Setup dynDNS Script
|
|
|
|
|
2023-04-28 21:25:21 +00:00
|
|
|
- name: Dyndns - Install needed tools
|
|
|
|
become: true
|
2021-08-28 14:50:37 +00:00
|
|
|
ansible.builtin.package:
|
2019-10-06 20:55:56 +00:00
|
|
|
name: curl
|
|
|
|
state: present
|
2023-04-28 21:25:21 +00:00
|
|
|
diff: false
|
2019-10-06 20:55:56 +00:00
|
|
|
|
2023-04-28 21:25:21 +00:00
|
|
|
- name: Dyndns - Copy dynDNS script
|
|
|
|
become: true
|
2021-08-28 14:50:37 +00:00
|
|
|
ansible.builtin.template:
|
2019-11-12 20:06:04 +00:00
|
|
|
src: "{{ role_path }}/templates/ddns-hosts.sh"
|
2019-10-06 20:55:56 +00:00
|
|
|
dest: /usr/local/bin/ddns-hosts.sh
|
|
|
|
owner: "{{ ansible_user_id }}"
|
|
|
|
group: "{{ ansible_user_id }}"
|
2023-04-28 21:25:21 +00:00
|
|
|
mode: "0775"
|
|
|
|
- name: "Dyndns - Create cronjob for {{ ddns_zone }} dynDNS script"
|
|
|
|
become: true
|
2021-08-28 14:50:37 +00:00
|
|
|
ansible.builtin.cron:
|
2021-05-08 16:22:48 +00:00
|
|
|
name: "{{ ddns_zone }} dynDNS"
|
2019-10-06 20:55:56 +00:00
|
|
|
minute: "*/5"
|
|
|
|
hour: "*"
|
2019-12-31 20:32:44 +00:00
|
|
|
job: "/usr/local/bin/ddns-hosts.sh > /dev/null{% if ddns_silence is defined and ddns_silence is sameas true %} 2>&1{% endif %}"
|