---

- include: install_r.yml
  tags: r

- include: build_r_package.yml
  tags: r
  
- name: R | Cron job template
  template: src=run-predictions.sh.j2
            dest={{ virtualenv_path }}/src/fire-risk/r_code/run-predictions.sh
            owner={{ gunicorn_user }}
            mode="u+x,g+x,o+x"
  tags: r

- cron:
    name: "run predictions"
    day: "*/3"
    user: "{{gunicorn_user}}"
    job: "{{ virtualenv_path }}/src/fire-risk/r_code/run-predictions.sh"
    state: "{{ 'present' if deployment_env != 'vagrant' else 'absent' }}"
  tags: r

---

- include: install_r.yml
  tags: r

- include: build_r_package.yml
  tags: r
  
- name: R | Cron job template
  template: src=run-predictions.sh.j2
            dest={{ virtualenv_path }}/src/fire-risk/r_code/run-predictions.sh
            owner={{ gunicorn_user }}
            mode="u+x,g+x,o+x"
  tags: r

- cron:
    name: "run predictions"
    minute: "0"
    hour: "0"
    day: "*/3"
    user: "{{gunicorn_user}}"
    job: "{{ virtualenv_path }}/src/fire-risk/r_code/run-predictions.sh"
    state: "{{ 'present' if deployment_env != 'vagrant' else 'absent' }}"
  tags: r

Fix predictions crontab, ONE time every 3 days
Fix predictions crontab, ONE time every 3 days
