From e11a62e9141f85c1c73c129b68438bfa1deeba24 Mon Sep 17 00:00:00 2001 From: Colin Copeland Date: Wed, 21 Nov 2018 12:08:43 -0500 Subject: [PATCH 1/3] allow optional celery app name override --- README.rst | 1 + defaults/main.yml | 1 + templates/celery.conf | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 73340c8..630d121 100644 --- a/README.rst +++ b/README.rst @@ -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"`` diff --git a/defaults/main.yml b/defaults/main.yml index eafecb8..fc21e3a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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: "" diff --git a/templates/celery.conf b/templates/celery.conf index d61c2d8..40eecc8 100644 --- a/templates/celery.conf +++ b/templates/celery.conf @@ -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 From b768d3cb7df41c0a5d085f4e00016342ac8e9df3 Mon Sep 17 00:00:00 2001 From: Colin Copeland Date: Wed, 21 Nov 2018 12:34:20 -0500 Subject: [PATCH 2/3] fix deprecation warning --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 2623704..547a3a0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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: From b32d042ff35266264dc2dedede1a2ea020c03887 Mon Sep 17 00:00:00 2001 From: Colin Copeland Date: Wed, 21 Nov 2018 13:19:37 -0500 Subject: [PATCH 3/3] add release notes --- CHANGES.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 2e21819..ad92a4a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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 ----------------------------