Skip to content

Commit

Permalink
Merge pull request #39 from caktus/celery-app-override
Browse files Browse the repository at this point in the history
Allow customization of the celery application name
  • Loading branch information
copelco authored Nov 23, 2018
2 parents 964c323 + b32d042 commit dc8bc0f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ v 0.9.n+1 on Month Day, Year
* TBD


v 0.9.19 on Nov 21, 2018
----------------------------

* Add ability to customize Celery app name via ``celery_app`` variable.


v 0.9.18 on Sep 26, 2018
----------------------------

Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ The following variables are used by the ``tequila-django`` role:
- ``cache_host`` **optional**
- ``broker_host`` **optional**
- ``broker_password`` **optional**
- ``celery_app`` **default:** ``"{{ project_name }}"`` (e.g. the app name passed to ``celery -A APP_NAME worker``)
- ``celery_worker_extra_args`` **default:** ``"--loglevel=INFO"``
- ``celery_events`` **default:** ``false``
- ``celery_camera_class`` **default:** ``"django_celery_monitor.camera.Camera"``
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ is_web: false
is_worker: false
is_celery_beat: false
extra_env: {}
celery_app: "{{ project_name }}"
celery_events: false
celery_camera_class: "django_celery_monitor.camera.Camera"
project_subdir: ""
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

- name: restart supervisord
service: name=supervisor state=restarted
when: supervisord_conf|changed
when: supervisord_conf is changed

- name: store path to github key
set_fact:
Expand Down
2 changes: 1 addition & 1 deletion templates/celery.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[program:{{ project_name }}-celery-{{ name }}]
command={{ django_dir }}/dotenv.sh {% if use_newrelic %}{{ venv_dir }}/bin/newrelic-admin run-program {% endif %}{{ venv_dir }}/bin/celery -A {{ project_name }} {{ command }} {{ flags }}
command={{ django_dir }}/dotenv.sh {% if use_newrelic %}{{ venv_dir }}/bin/newrelic-admin run-program {% endif %}{{ venv_dir }}/bin/celery -A {{ celery_app }} {{ command }} {{ flags }}
user={{ project_user }}
directory={{ django_dir }}
autostart=true
Expand Down

0 comments on commit dc8bc0f

Please sign in to comment.