- name: backup | system setup | cron
  become: true
  become_user: root
  cron:
    name: "backup {{ item.sequence }}"
    job: "/root/bin/backup.new {{ item.switch }}"
    state: present
    minute: "{{ item.minute }}"
    hour: "{{ item.hour }}"
    day: "{{ item.day }}"
    month: "{{ item.month }}"
    weekday: "{{ item.weekday }}"
  loop:
    - { sequence: "daily", switch: "-d", minute: "0", hour: "3", day: "*", month: "*", weekday: "*" }
    - { sequence: "weekly", switch: "-w", minute: "0", hour: "4", day: "*", month: "*", weekday: "0" }
    - { sequence: "monthly", switch: "-m", minute: "30", hour: "6", day: "1", month: "*", weekday: "*" }
    - { sequence: "yearly", switch: "-y", minute: "59", hour: "23", day: "31", month: "12", weekday: "*" }