---
- name: Make sure cron and curl are installed
  apt:
    name:
      - cron
      - curl
    state: present

- name: Setup cron file for desec.io updates
  ansible.builtin.template:
    src: "templates/desec-dyndns.cron.j2"
    dest: "/etc/cron.d/desec-dyndns"
    owner: root
    group: root
    mode: "0644"
  notify: Reload cron
  # There is ansible.builtin.cron, but this makes configuration much
  # more complicated, so we stick to the template.