Hubs: improve gunicorn config

This commit is contained in:
Aurélien Bompard 2018-02-21 10:02:54 +00:00
parent 475709bd70
commit 87dc6e0e9e
4 changed files with 22 additions and 1 deletions

View file

@ -5,6 +5,7 @@ hubs_base_dir: "/srv/hubs"
hubs_code_dir: "{{ hubs_base_dir }}/fedora-hubs"
hubs_conf_dir: "{{ hubs_base_dir }}/config"
hubs_var_dir: "{{ hubs_base_dir }}/var"
hubs_log_dir: "{{ hubs_base_dir }}/log"
hubs_db_type: sqlite
hubs_db_user: hubs
hubs_db_password: changeme

View file

@ -59,6 +59,20 @@
persistent: yes
- name: Create the log directory
file:
path: "{{ hubs_log_dir }}"
owner: "{{ main_user }}"
state: directory
- name: Install the Gunicorn config file
template:
src: gunicorn.py
dest: "{{ hubs_conf_dir }}/gunicorn.py"
notify: "hubs configuration change"
- name: Start and enable the services
service: name={{ item }} state=started enabled=yes
with_items:

View file

@ -1,2 +1,2 @@
HUBS_CONFIG={{ hubs_conf_dir }}/hubs.py
LOGGING_CONFIG={{ hubs_conf_dir }}/logging.ini
WEBAPP_CONFIG={{ hubs_conf_dir }}/gunicorn.py

View file

@ -0,0 +1,6 @@
bind = "127.0.0.1:8000"
threads = 12
logconfig = "{{ hubs_conf_dir }}/logging.ini"
accesslog = "{{ hubs_log_dir }}/access.log"
errorlog = "{{ hubs_log_dir }}/error.log"
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" (%(L)ss)'