---

  - name: Install cron entry
    lineinfile: dest=/etc/crontab state=present
      line="* * * * * {{celos_user}} curl -X POST localhost:8080/celos/scheduler"
      regexp="celos/scheduler"
    sudo: yes
    tags: cron

  - name: Prepare configuration dir
    shell: sudo mkdir -p {{celos_workflows_dir}} && sudo chown {{celos_user}} {{celos_workflows_dir}}

  - name: Prepare database dir
    shell: sudo mkdir -p {{celos_db_dir}} && sudo chown {{celos_user}} {{celos_db_dir}}

  - name: Prepare log dir
    shell: sudo mkdir -p {{celos_log_dir}} && sudo chown {{celos_user}} {{celos_log_dir}}

---

  - name: Install cron entry for scheduler
    lineinfile: dest=/etc/crontab state=present
      line="* * * * * {{celos_user}} curl -X POST localhost:8080/celos/scheduler"
      regexp="celos/scheduler"
    sudo: yes
    tags: cron

  - name: Install cron entry to refresh Kerberos ticket every hour
    lineinfile: dest=/etc/crontab state=present
      line="0 * * * * {{celos_user}} kinit -k -t /home/celos/celos.keytab celos@COLLECTIVE-MEDIA.NET"
      regexp="celos@COLLECTIVE-MEDIA.NET"
    sudo: yes
    tags: cron

  - name: Prepare configuration dir
    shell: sudo mkdir -p {{celos_workflows_dir}} && sudo chown {{celos_user}} {{celos_workflows_dir}}

  - name: Prepare database dir
    shell: sudo mkdir -p {{celos_db_dir}} && sudo chown {{celos_user}} {{celos_db_dir}}

  - name: Prepare log dir
    shell: sudo mkdir -p {{celos_log_dir}} && sudo chown {{celos_user}} {{celos_log_dir}}

Install cron entry to refresh Kerberos ticket every hour.
Install cron entry to refresh Kerberos ticket every hour.
