ansible-role-server/tasks/dyndns.yml

25 lines
670 B
YAML

---
# 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
- name: "dyndns - Create cronjob for {{ ddns_domain }} dynDNS script"
become: yes
cron:
name: "{{ ddns_domain }} 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 %}"