placement: Add support for using uWSGI
Needed to set log_file because logs ended up with following name: <frozen importlib._bootstrap>.log Change-Id: I706adef8efbd44e6d9f82f67f5a3cdb529f02fff
This commit is contained in:
parent
6eb6fee6ee
commit
454dc2a952
@ -8,6 +8,7 @@ placement_services:
|
||||
volumes: "{{ placement_api_default_volumes + placement_api_extra_volumes }}"
|
||||
dimensions: "{{ placement_api_dimensions }}"
|
||||
healthcheck: "{{ placement_api_healthcheck }}"
|
||||
wsgi: "placement.wsgi.api:application"
|
||||
haproxy:
|
||||
placement_api:
|
||||
enabled: "{{ enable_placement }}"
|
||||
@ -148,3 +149,8 @@ placement_ks_users:
|
||||
placement_enable_tls_backend: "{{ kolla_enable_tls_backend }}"
|
||||
|
||||
placement_copy_certs: "{{ kolla_copy_ca_into_containers | bool or placement_enable_tls_backend | bool }}"
|
||||
|
||||
####################
|
||||
# WSGI
|
||||
####################
|
||||
placement_wsgi_provider: "uwsgi"
|
||||
|
@ -63,11 +63,32 @@
|
||||
src: "{{ item }}"
|
||||
dest: "{{ node_config_directory }}/placement-api/placement-api-wsgi.conf"
|
||||
mode: "0660"
|
||||
when: service | service_enabled_and_mapped_to_host
|
||||
when:
|
||||
- service | service_enabled_and_mapped_to_host
|
||||
- placement_wsgi_provider == "apache"
|
||||
with_first_found:
|
||||
- "{{ node_custom_config }}/placement/{{ inventory_hostname }}/placement-api-wsgi.conf"
|
||||
- "{{ node_custom_config }}/placement/placement-api-wsgi.conf"
|
||||
- "placement-api-wsgi.conf.j2"
|
||||
notify:
|
||||
- "Restart placement-api container"
|
||||
|
||||
- name: "Configure uWSGI for Placement"
|
||||
include_role:
|
||||
name: service-uwsgi-config
|
||||
vars:
|
||||
project_services: "{{ placement_services }}"
|
||||
service: "{{ placement_services['placement-api'] }}"
|
||||
service_name: "placement-api"
|
||||
service_uwsgi_config_http_port: "{{ placement_api_listen_port }}"
|
||||
service_uwsgi_config_module: "{{ service.wsgi }}"
|
||||
service_uwsgi_config_tls_backend: "{{ placement_enable_tls_backend | bool }}"
|
||||
service_uwsgi_config_tls_cert: "/etc/placement/certs/placement-cert.pem"
|
||||
service_uwsgi_config_tls_key: "/etc/placement/certs/placement-key.pem"
|
||||
service_uwsgi_config_uid: "placement"
|
||||
when:
|
||||
- service | service_enabled_and_mapped_to_host
|
||||
- placement_wsgi_provider == "uwsgi"
|
||||
|
||||
- name: Copying over migrate-db.rc.j2 configuration
|
||||
become: true
|
||||
|
@ -1,7 +1,8 @@
|
||||
{% set apache_binary = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
|
||||
{% set apache_conf_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %}
|
||||
{% set command = '/usr/sbin/{{ apache_binary }} -DFOREGROUND' if placement_wsgi_provider == 'apache' else 'uwsgi /etc/placement/placement-api-uwsgi.ini' %}
|
||||
{
|
||||
"command": "/usr/sbin/{{ apache_binary }} -DFOREGROUND",
|
||||
"command": "{{ command }}",
|
||||
"config_files": [
|
||||
{
|
||||
"source": "{{ container_config_directory }}/placement.conf",
|
||||
@ -14,13 +15,19 @@
|
||||
"dest": "/etc/placement/{{ placement_policy_file }}",
|
||||
"owner": "placement",
|
||||
"perm": "0600"
|
||||
}{% endif %},
|
||||
}{% endif %}{% if placement_wsgi_provider == 'apache' %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/placement-api-wsgi.conf",
|
||||
"dest": "/etc/{{ apache_conf_dir }}/00-placement-api.conf",
|
||||
"owner": "placement",
|
||||
"perm": "0600"
|
||||
},
|
||||
}{% elif placement_wsgi_provider == 'uwsgi' %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/placement-api-uwsgi.ini",
|
||||
"dest": "/etc/placement/placement-api-uwsgi.ini",
|
||||
"owner": "placement",
|
||||
"perm": "0600"
|
||||
}{% endif %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/migrate-db.rc",
|
||||
"dest": "/etc/placement/migrate-db.rc",
|
||||
|
@ -1,7 +1,7 @@
|
||||
[DEFAULT]
|
||||
debug = {{ placement_logging_debug }}
|
||||
|
||||
log_dir = /var/log/kolla/placement
|
||||
log_file = /var/log/kolla/placement/{{ service_name }}.log
|
||||
|
||||
state_path = /var/lib/placement
|
||||
|
||||
|
@ -11,3 +11,5 @@ features:
|
||||
- Variable
|
||||
* - Nova
|
||||
- nova_wsgi_provider
|
||||
* - Placement
|
||||
- placement_wsgi_provider
|
||||
|
Loading…
x
Reference in New Issue
Block a user