---

- name: cron save-reports
  cron:
    name: "faf save-reports"
    user: faf
    job: "faf save-reports --speedup >> /var/log/faf/save-reports.log 2>&1"
    minute: "*/5"
    state: present
  become: yes

- name: cron create-problems-speedup
  cron:
    name: "faf create-problems-speedup with type {{ item}}"
    user: faf
    job: "faf create-problems -p {{ item }} --speedup >> /var/log/faf/create-problems.log 2>&1"
    minute: 30
    hour: "2"
    state: present
  become: yes
  with_items:
    - "core"
    - "kerneloops"
    - "python"
    - "ruby"

- name: cron create-problems
  cron:
    name: "faf create-problems with type {{ item}}"
    user: faf
    job: "faf create-problems -p {{ item }} >> /var/log/faf/create-problems.log 2>&1"
    day: "15"
    minute: 30
    hour: "14"
    state: present
  become: yes
  with_items:
    - "core"
    - "kerneloops"
    - "python"
    - "ruby"

- name: cron reposync
  cron:
    name: "faf reposync"
    user: faf
    job: "faf reposync >> /var/log/faf/reposync.log 2>&1"
    minute: 5
    hour: 3
    state: present
  become: yes

- name: retrace symbols
  cron:
    name: "retrace symbols with type {{ item.type }}"
    user: faf
    job: "faf retrace --workers 4 -dp {{ item.type }} --max-fail-count 1 >> /var/log/faf/retrace-{{ item.type }}.log 2>&1"
    minute: 32
    hour: 2
    weekday: "{{ item.day }}"
    state: present
  become: yes
  with_items:
    - { type: "core", day: "2,4,6" }
    - { type: "kerneloops", day: "1,3,5" }

- name: cron - faf find-crashfn core
  cron:
    name: "cron for faf find-crashfn for core"
    user: faf
    job: "faf find-crashfn -p core >> /var/log/faf/find-crashfn-core.log 2>&1"
    special_time: daily
    state: present

- name: cron - faf find-crashfn kerneloops
  cron:
    name: "cron for faf find-crashfn for kerneloops"
    user: faf
    job: "faf find-crashfn -p kerneloops >> /var/log/faf/find-crashfn-kerneloops.log 2>&1"
    minute: 15
    hour: "*/3"
    state: present
