---
- name: Configure crontab
  hosts: all
  become: true
  tasks:
    - name: Ensure the script runs once a day
      cron:
        name: "Run daily script"
        minute: "0"
        hour: "0"
        job: "/usr/local/setupfiles/bin/update"

    - name: Ensure the system reboots once a week
      cron:
        name: "Weekly reboot"
        minute: "0"
        hour: "0"
        weekday: "0"
        job: "/sbin/reboot"