File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 3
3
systemd :
4
4
name : " {{item.name}}.service"
5
5
state : started
6
- enabled : " {{item.enable|default(no )}}"
6
+ enabled : " {{item.enable|default('no' )}}"
7
7
with_items : " {{celery_services}}"
8
8
9
9
- name : " restart celery services"
10
10
systemd :
11
11
name : " {{item.name}}.service"
12
12
state : restarted
13
- enabled : " {{item.enable|default(no )}}"
13
+ enabled : " {{item.enable|default('no' )}}"
14
14
with_items : " {{celery_services}}"
15
15
16
16
- name : " stop celery services"
Original file line number Diff line number Diff line change @@ -3,17 +3,19 @@ Description=Celery Service
3
3
After=network.target
4
4
5
5
[Service]
6
+ {% if item .multi is defined -%}
6
7
Type=forking
8
+ {% endif %}
7
9
User={{celery_user}}
8
10
Group={{celery_user}}
9
11
EnvironmentFile={{celery_env_dir}}/{{item.name}}
10
12
WorkingDirectory={{celery_working_dir}}
11
- ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
13
+ ExecStart=/bin/sh -c '${CELERY_BIN} ${CELERY_MULTI_START} ${CELERYD_NODES} \
12
14
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
13
15
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
14
- ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
16
+ ExecStop=/bin/sh -c '${CELERY_BIN} ${CELERY_MULTI_STOP} ${CELERYD_NODES} \
15
17
--pidfile=${CELERYD_PID_FILE}'
16
- ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
18
+ ExecReload=/bin/sh -c '${CELERY_BIN} ${CELERY_MULTI_RESTART} ${CELERYD_NODES} \
17
19
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
18
20
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
19
21
Original file line number Diff line number Diff line change 4
4
{{k}}='{{v}}'
5
5
{% endif %}
6
6
{% endfor %}
7
+ {% if item .multi is defined %}
8
+ CELERY_MULTI_START='multi start'
9
+ CELERY_MULTI_STOP='multi stop'
10
+ CELERY_MULTI_RESTART='multi restart'
11
+ {% endif %}
You can’t perform that action at this time.
0 commit comments