kolla-ansible/ansible/roles/placement/templates/placement-api-wsgi.conf.j2
Michal Nasiadka 0240763d7d Add proper wsgi loglevel when openstack_logging_debug
Change-Id: I51144d92f34ed51c499a4119c059e6475d02eb46
2019-10-24 09:33:05 +00:00

37 lines
1.5 KiB
Django/Jinja

{% set log_dir = '/var/log/kolla/placement' %}
{% if placement_install_type == 'binary' %}
{% set python_path = '/usr/lib/python3/dist-packages' if kolla_base_distro in ['debian', 'ubuntu'] else '/usr/lib/python2.7/site-packages' %}
{% else %}
{% set python_path = '/var/lib/kolla/venv/lib/python' + distro_python_version + '/site-packages' %}
{% endif %}
{% set wsgi_directory = '/usr/bin' if placement_install_type == 'binary' else '/var/lib/kolla/venv/bin' %}
Listen {{ api_interface_address | put_address_in_context('url') }}:{{ placement_api_listen_port }}
ServerSignature Off
ServerTokens Prod
TraceEnable off
{% if placement_logging_debug | bool %}
LogLevel info
{% endif %}
<VirtualHost *:{{ placement_api_listen_port }}>
WSGIDaemonProcess placement-api processes={{ openstack_service_workers }} threads=1 user=placement group=placement display-name=%{GROUP} python-path={{ python_path }}
WSGIProcessGroup placement-api
WSGIScriptAlias / {{ wsgi_directory }}/placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog "{{ log_dir }}/placement-api.log"
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat
CustomLog "{{ log_dir }}/placement-api-access.log" logformat
<Directory {{ wsgi_directory }}>
<Files placement-api>
Require all granted
</Files>
</Directory>
</VirtualHost>