nova: Add support for using uWSGI
Depends-On: https://review.opendev.org/c/openstack/kolla/+/935974 Change-Id: I084ed924a60ae266c3f51a44c22834402ef7f00e
This commit is contained in:
parent
638fb65465
commit
63801d1a33
@ -9,6 +9,7 @@ nova_services:
|
||||
volumes: "{{ nova_api_default_volumes + nova_api_extra_volumes }}"
|
||||
dimensions: "{{ nova_api_dimensions }}"
|
||||
healthcheck: "{{ nova_api_healthcheck }}"
|
||||
wsgi: "nova.wsgi.osapi_compute:application"
|
||||
haproxy:
|
||||
nova_api:
|
||||
enabled: "{{ enable_nova }}"
|
||||
@ -37,6 +38,7 @@ nova_services:
|
||||
volumes: "{{ nova_metadata_default_volumes + nova_metadata_extra_volumes }}"
|
||||
dimensions: "{{ nova_metadata_dimensions }}"
|
||||
healthcheck: "{{ nova_metadata_healthcheck }}"
|
||||
wsgi: "nova.wsgi.metadata:application"
|
||||
haproxy:
|
||||
nova_metadata:
|
||||
enabled: "{{ enable_nova }}"
|
||||
@ -310,5 +312,9 @@ nova_source_version: "{{ kolla_source_version }}"
|
||||
# TLS
|
||||
####################
|
||||
nova_enable_tls_backend: "{{ kolla_enable_tls_backend }}"
|
||||
|
||||
nova_copy_certs: "{{ kolla_copy_ca_into_containers | bool or nova_enable_tls_backend | bool }}"
|
||||
|
||||
####################
|
||||
# WSGI
|
||||
####################
|
||||
nova_wsgi_provider: "uwsgi"
|
||||
|
@ -87,7 +87,9 @@
|
||||
dest: "{{ node_config_directory }}/nova-api/nova-api-wsgi.conf"
|
||||
mode: "0660"
|
||||
become: true
|
||||
when: service | service_enabled_and_mapped_to_host
|
||||
when:
|
||||
- service | service_enabled_and_mapped_to_host
|
||||
- nova_wsgi_provider == "apache"
|
||||
|
||||
- name: Copying over nova-metadata-wsgi.conf
|
||||
vars:
|
||||
@ -97,7 +99,30 @@
|
||||
dest: "{{ node_config_directory }}/nova-metadata/nova-metadata-wsgi.conf"
|
||||
mode: "0660"
|
||||
become: true
|
||||
when: service | service_enabled_and_mapped_to_host
|
||||
when:
|
||||
- service | service_enabled_and_mapped_to_host
|
||||
- nova_wsgi_provider == "apache"
|
||||
|
||||
- name: "Configure uWSGI for Nova"
|
||||
include_role:
|
||||
name: service-uwsgi-config
|
||||
vars:
|
||||
project_services: "{{ nova_services }}"
|
||||
service: "{{ nova_services[item.name] }}"
|
||||
service_name: "{{ item.name }}"
|
||||
service_uwsgi_config_http_port: "{{ item.port }}"
|
||||
service_uwsgi_config_log_file_chmod: "644"
|
||||
service_uwsgi_config_module: "{{ service.wsgi }}"
|
||||
service_uwsgi_config_tls_backend: "{{ nova_enable_tls_backend | bool }}"
|
||||
service_uwsgi_config_tls_cert: "/etc/nova/certs/nova-cert.pem"
|
||||
service_uwsgi_config_tls_key: "/etc/nova/certs/nova-key.pem"
|
||||
service_uwsgi_config_uid: "nova"
|
||||
when:
|
||||
- service | service_enabled_and_mapped_to_host
|
||||
- nova_wsgi_provider == "uwsgi"
|
||||
loop:
|
||||
- { name: "nova-api", port: "{{ nova_api_listen_port }}" }
|
||||
- { name: "nova-metadata", port: "{{ nova_metadata_listen_port }}" }
|
||||
|
||||
- name: Copying over vendordata file
|
||||
vars:
|
||||
|
@ -1,20 +1,27 @@
|
||||
{% 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 nova_wsgi_provider == 'apache' else 'uwsgi /etc/nova/nova-api-uwsgi.ini' %}
|
||||
{
|
||||
"command": "/usr/sbin/{{ apache_binary }} -DFOREGROUND",
|
||||
"command": "{{ command }}",
|
||||
"config_files": [
|
||||
{
|
||||
"source": "{{ container_config_directory }}/nova.conf",
|
||||
"dest": "/etc/nova/nova.conf",
|
||||
"owner": "nova",
|
||||
"perm": "0600"
|
||||
},
|
||||
}{% if nova_wsgi_provider == 'apache' %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/nova-api-wsgi.conf",
|
||||
"dest": "/etc/{{ apache_conf_dir }}/nova-api-wsgi.conf",
|
||||
"owner": "nova",
|
||||
"perm": "0600"
|
||||
}{% if nova_policy_file is defined %},
|
||||
}{% elif nova_wsgi_provider == 'uwsgi' %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/nova-api-uwsgi.ini",
|
||||
"dest": "/etc/nova/nova-api-uwsgi.ini",
|
||||
"owner": "nova",
|
||||
"perm": "0600"
|
||||
}{% endif %}{% if nova_policy_file is defined %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/{{ nova_policy_file }}",
|
||||
"dest": "/etc/nova/{{ nova_policy_file }}",
|
||||
|
@ -1,20 +1,27 @@
|
||||
{% 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 nova_wsgi_provider == 'apache' else 'uwsgi /etc/nova/nova-metadata-uwsgi.ini' %}
|
||||
{
|
||||
"command": "/usr/sbin/{{ apache_binary }} -DFOREGROUND",
|
||||
"command": "{{ command }}",
|
||||
"config_files": [
|
||||
{
|
||||
"source": "{{ container_config_directory }}/nova.conf",
|
||||
"dest": "/etc/nova/nova.conf",
|
||||
"owner": "nova",
|
||||
"perm": "0600"
|
||||
},
|
||||
}{% if nova_wsgi_provider == 'apache' %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/nova-metadata-wsgi.conf",
|
||||
"dest": "/etc/{{ apache_conf_dir }}/nova-metadata-wsgi.conf",
|
||||
"dest": "/etc/{{ apache_conf_dir }}/nova-api-wsgi.conf",
|
||||
"owner": "nova",
|
||||
"perm": "0600"
|
||||
}{% if nova_policy_file is defined %},
|
||||
}{% elif nova_wsgi_provider == 'uwsgi' %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/nova-metadata-uwsgi.ini",
|
||||
"dest": "/etc/nova/nova-metadata-uwsgi.ini",
|
||||
"owner": "nova",
|
||||
"perm": "0600"
|
||||
}{% endif %}{% if nova_policy_file is defined %},
|
||||
{
|
||||
"source": "{{ container_config_directory }}/{{ nova_policy_file }}",
|
||||
"dest": "/etc/nova/{{ nova_policy_file }}",
|
||||
|
13
releasenotes/notes/uwsgi-aef85ccbc76dab3e.yaml
Normal file
13
releasenotes/notes/uwsgi-aef85ccbc76dab3e.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Adds support for running following services using uWSGI (without using
|
||||
Apache+mod_wsgi) which is enabled by default. To disable it please
|
||||
set <service>_wsgi_provider to ``apache`` (default is ``uwsgi``):
|
||||
|
||||
.. list-table::
|
||||
|
||||
* - Service
|
||||
- Variable
|
||||
* - Nova
|
||||
- nova_wsgi_provider
|
Loading…
x
Reference in New Issue
Block a user