---

- name: Schedule cron jobs
  cron:
    name: "{{ item.name | default(item.id) }}"
    cron_file: "{{ 'ansible_cron_' ~ item.id if ansible_os_family != 'Solaris' else 'crontabs/' ~ item.user }}"
    user: "{{ item.user }}"
    hour: "{{ item.hour | default(omit) }}"
    minute: "{{ item.minute | default(omit) }}"
    day: "{{ item.day | default(omit) }}"
    month: "{{ item.month | default(omit) }}"
    weekday: "{{ item.weekday | default(omit) }}"
    job: "{{ item.job }}"
    state: "{{ item.state | default(omit) }}"
  with_flattened:
    - "{{ all_crontabs }}"
    - "{{ group_crontabs }}"
    - "{{ host_crontabs }}"
    - "{{ crontabs }}"  # legacy
  notify: refresh cron

---

- name: Schedule cron jobs
  cron:
    name: "{{ item.name | default(item.id) }}"
    cron_file: "{{ 'ansible_cron_' ~ item.id if ansible_os_family != 'Solaris' else 'crontabs/' ~ item.user }}"
    user: "{{ item.user }}"
    hour: "{{ item.hour | default(omit) }}"
    minute: "{{ item.minute | default(omit) }}"
    day: "{{ item.day | default(omit) }}"
    month: "{{ item.month | default(omit) }}"
    weekday: "{{ item.weekday | default(omit) }}"
    job: "{{ item.job }}"
    state: "{{ item.state | default(omit) }}"
  with_inheritance_chain: "crontabs"
  notify: refresh cron

Switch cron to inheritance chain, drop legacy `crontabs` struct
Switch cron to inheritance chain, drop legacy `crontabs` struct
