ansible-role-server/tasks/dyndns.yml

26 lines
733 B
YAML

---
# Server/Dyndns: Setup dynDNS Script
- name: Dyndns - Install needed tools
become: true
ansible.builtin.package:
name: curl
state: present
diff: false
- name: Dyndns - Copy dynDNS script
become: true
ansible.builtin.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"
- name: "Dyndns - Create cronjob for {{ ddns_zone }} dynDNS script"
become: true
ansible.builtin.cron:
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 %}"