ansible-role-server/tasks/dyndns.yml

25 lines
666 B
YAML
Raw Normal View History

---
# Server/Dyndns: Setup dynDNS Script
- name: dyndns - Install needed tools
become: yes
package:
name: curl
state: present
- name: dyndns - Copy dynDNS script
become: yes
template:
src: "{{ role_path }}/templates/ddns-hosts.sh"
dest: /usr/local/bin/ddns-hosts.sh
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0775
2021-05-08 16:22:48 +00:00
- name: "dyndns - Create cronjob for {{ ddns_zone }} dynDNS script"
become: yes
cron:
2021-05-08 16:22:48 +00:00
name: "{{ ddns_zone }} dynDNS"
minute: "*/5"
hour: "*"
job: "/usr/local/bin/ddns-hosts.sh > /dev/null{% if ddns_silence is defined and ddns_silence is sameas true %} 2>&1{% endif %}"