mirror of
https://github.com/fspc/workstand.git
synced 2026-09-16 16:41:38 -04:00
Initial commit.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: start supervisor
|
||||
service: name=supervisor state=started
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Configure supvervisor to run {{ app_name }}
|
||||
action: template src={{ group_names[0] }}/supervisor-program.conf dest=/etc/supervisor/conf.d/{{ app_name }}.conf
|
||||
tags:
|
||||
- supervisor
|
||||
- deploy
|
||||
|
||||
- name: Load and re-read group configs
|
||||
action: supervisorctl name='{{ app_name }}:' state=present config=/etc/supervisor/supervisord.conf
|
||||
tags:
|
||||
- supvervisor
|
||||
- deploy
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
- name: Configure supvervisor to run {{ app_name }}
|
||||
action: template src=staging/supervisor-program.conf dest=/etc/supervisor/conf.d/{{ app_name }}.conf
|
||||
notify: restart supervisor
|
||||
@@ -0,0 +1,45 @@
|
||||
[group:{{ app_name }}]
|
||||
programs=django,celerybeat,celeryworker
|
||||
[program:django]
|
||||
command={{ venv }}/bin/gunicorn -b 127.0.0.1:{{ app_port }} {{ app_name }}.wsgi:application
|
||||
directory={{ app_dir }}
|
||||
environment=DJANGO_DB_PASSWORD="{{ db_user_password }}",DJANGO_SECRET_KEY="{{ django_key }}",DJANGO_SETTINGS_MODULE="{{ settings_module }}"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
user={{ app_name }}
|
||||
|
||||
[program:celerybeat]
|
||||
command={{ venv }}/bin/celery -A {{ app_name }} beat
|
||||
environment=DJANGO_DB_PASSWORD="{{ db_user_password }}",DJANGO_SECRET_KEY="{{ django_key }}",DJANGO_SETTINGS_MODULE="{{ settings_module }}"
|
||||
directory={{ app_dir }}
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
user={{ app_name }}
|
||||
|
||||
[program:celeryworker]
|
||||
command={{ venv }}/bin/celery -A {{ app_name }} worker
|
||||
environment=DJANGO_DB_PASSWORD="{{ db_user_password }}",DJANGO_SECRET_KEY="{{ django_key }}",DJANGO_SETTINGS_MODULE="{{ settings_module }}",PYTHON_PATH={{ app_dir }}
|
||||
directory={{ app_dir }}
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/celeryd/{{ app_name }}.log
|
||||
stderr_logfile=/var/log/celeryd/{{ app_name }}.log
|
||||
user={{ app_name }}
|
||||
numprocs=1
|
||||
|
||||
startsecs=10
|
||||
|
||||
; Need to wait for currently executing tasks to finish at shutdown.
|
||||
; Increase this if you have very long running tasks.
|
||||
stopwaitsecs = 600
|
||||
|
||||
; When resorting to send SIGKILL to the program to terminate it
|
||||
; send SIGKILL to its whole process group instead,
|
||||
; taking care of its children as well.
|
||||
killasgroup=true
|
||||
|
||||
; Set Celery priority higher than default (999)
|
||||
; so, if rabbitmq is supervised, it will start first.
|
||||
priority=1000
|
||||
@@ -0,0 +1,10 @@
|
||||
[program:{{ app_name }}]
|
||||
command={{ venv }}/bin/gunicorn -b 127.0.0.1:{{ app_port }} {{ app_name }}.wsgi:application
|
||||
directory={{ app_dir }}
|
||||
environment=DB_PASSWORD="{{ db_user_password }}",DJANGO_SECRET_KEY="{{ django_key }}",DJANGO_SETTINGS_MODULE="{{settings_module}}"
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
|
||||
[eventlistener:memmon]
|
||||
command=memmon -p {{ app_name }}=50MB -m vagrant@{{ app_domain_name}}
|
||||
events=TICK_60
|
||||
Reference in New Issue
Block a user