---
- name: Configure Celery service definition
  template: src=celeryd.j2
            dest=/etc/init.d/celeryd
            mode=0755
  notify:
    - Restart Celery

- name: Configure Celery service definition defaults
  template: src=celeryd-defaults.j2 dest=/etc/default/celeryd
  notify:
    - Restart Celery

- name: Enable Celery service
  service: name=celeryd enabled=yes state=started

---
- name: Configure Celery service definition
  template: src=celeryd.j2
            dest=/etc/init.d/celeryd
            mode=0755
  notify:
    - Restart Celery

- name: Configure Celery service definition defaults
  template: src=celeryd-defaults.j2 dest=/etc/default/celeryd
  notify:
    - Restart Celery

- name: Enable Celery service
  service: name=celeryd enabled=yes state=started

- name: Setup daily Celery service restart
  cron:
    name: celery-restart
    special_time: daily
    job: service celeryd restart
    state: present

Add cron task to restart Celery every day
Add cron task to restart Celery every day

We occasionally encounter service disruptions due to hangups with the
Celery service. This brings a brute force solution to the problem by
scheduling a restart of the Celery service every day at ~3AM.
