Hubs: improve gunicorn config
This commit is contained in:
parent
475709bd70
commit
87dc6e0e9e
4 changed files with 22 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
6
roles/hubs/templates/gunicorn.py
Normal file
6
roles/hubs/templates/gunicorn.py
Normal 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)'
|
Loading…
Add table
Add a link
Reference in a new issue