From 6722e1846577c6baadacc12ff33ad3a7fbdeddb2 Mon Sep 17 00:00:00 2001 From: chenxing Date: Wed, 13 Mar 2019 21:25:51 +0800 Subject: [PATCH] ubuntu: update configuration Stein UCA Update wsgi configuration after services migrating to python3. Change-Id: I25d8db36dabd5f148b2ec96a30381c6a86fa710e Depends-On: https://review.openstack.org/#/c/625298/ Partially Implements: blueprint python3-support --- ansible/roles/aodh/templates/wsgi-aodh.conf.j2 | 10 +++++++++- ansible/roles/cinder/templates/cinder-wsgi.conf.j2 | 6 +++++- .../roles/gnocchi/templates/wsgi-gnocchi.conf.j2 | 10 +++++++++- .../roles/keystone/templates/wsgi-keystone.conf.j2 | 14 +++++++++++++- .../nova/templates/placement-api-wsgi.conf.j2 | 14 +++++++++++++- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/ansible/roles/aodh/templates/wsgi-aodh.conf.j2 b/ansible/roles/aodh/templates/wsgi-aodh.conf.j2 index 8e30d152ab..4763595142 100644 --- a/ansible/roles/aodh/templates/wsgi-aodh.conf.j2 +++ b/ansible/roles/aodh/templates/wsgi-aodh.conf.j2 @@ -1,4 +1,8 @@ -{% set python_path = '/usr/lib/python2.7/site-packages' if aodh_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% if aodh_install_type == 'binary' %} + {% set python_path = '/usr/lib/python3/dist-packages' if kolla_base_distro == 'ubuntu' else '/usr/lib/python2.7/site-packages' %} +{% else %} + {% set python_path = '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% endif %} {% set binary_path = '/usr/bin' if aodh_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} Listen {{ api_interface_address }}:{{ aodh_api_listen_port }} @@ -23,5 +27,9 @@ TraceEnable off WSGIApplicationGroup %{GLOBAL} WSGIDaemonProcess aodh group=aodh processes={{ openstack_service_workers }} threads=1 user=aodh python-path={{ python_path }} WSGIProcessGroup aodh +{% if kolla_install_type == 'binary' and kolla_base_distro == 'ubuntu' %} + WSGIScriptAlias / "{{ binary_path }}/python3-aodh-api" +{% else %} WSGIScriptAlias / "{{ binary_path }}/aodh-api" +{% endif %} diff --git a/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 b/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 index 224b07f137..7a43a55ae6 100644 --- a/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 +++ b/ansible/roles/cinder/templates/cinder-wsgi.conf.j2 @@ -1,4 +1,8 @@ -{% set python_path = '/usr/lib/python2.7/site-packages' if cinder_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% if cinder_install_type == 'binary' %} + {% set python_path = '/usr/lib/python3/dist-packages' if kolla_base_distro == 'ubuntu' else '/usr/lib/python2.7/site-packages' %} +{% else %} + {% set python_path = '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% endif %} Listen {{ api_interface_address }}:{{ cinder_api_listen_port }} ServerSignature Off diff --git a/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 b/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 index 3a289ed323..8cadbe6c25 100644 --- a/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 +++ b/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 @@ -1,4 +1,8 @@ -{% set python_path = '/usr/lib/python2.7/site-packages' if gnocchi_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% if gnocchi_install_type == 'binary' %} + {% set python_path = '/usr/lib/python3/dist-packages' if kolla_base_distro == 'ubuntu' else '/usr/lib/python2.7/site-packages' %} +{% else %} + {% set python_path = '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% endif %} {% set wsgi_path = '/usr/bin' if gnocchi_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} Listen {{ api_interface_address }}:{{ gnocchi_api_listen_port }} @@ -14,7 +18,11 @@ TraceEnable off WSGIApplicationGroup %{GLOBAL} WSGIDaemonProcess gnocchi group=gnocchi processes={{ openstack_service_workers }} threads=1 user=gnocchi python-path={{ python_path }} WSGIProcessGroup gnocchi +{% if kolla_install_type == 'binary' and kolla_base_distro == 'ubuntu' %} + WSGIScriptAlias / "{{ wsgi_path }}/python3-gnocchi-api" +{% else %} WSGIScriptAlias / "{{ wsgi_path }}/gnocchi-api" +{% endif %} Require all granted diff --git a/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 b/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 index 5e14169ab4..29a2c22fb5 100644 --- a/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 +++ b/ansible/roles/keystone/templates/wsgi-keystone.conf.j2 @@ -1,5 +1,9 @@ {% set keystone_log_dir = '/var/log/kolla/keystone' %} -{% set python_path = '/usr/lib/python2.7/site-packages' if keystone_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% if keystone_install_type == 'binary' %} + {% set python_path = '/usr/lib/python3/dist-packages' if kolla_base_distro == 'ubuntu' else '/usr/lib/python2.7/site-packages' %} +{% else %} + {% set python_path = '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% endif %} {% set binary_path = '/usr/bin' if keystone_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} Listen {{ api_interface_address }}:{{ keystone_public_listen_port }} Listen {{ api_interface_address }}:{{ keystone_admin_listen_port }} @@ -20,7 +24,11 @@ TraceEnable off WSGIDaemonProcess keystone-public processes={{ openstack_service_workers }} threads=1 user=keystone group=keystone display-name=%{GROUP} python-path={{ python_path }} WSGIProcessGroup keystone-public +{% if kolla_install_type == 'binary' and kolla_base_distro == 'ubuntu' %} + WSGIScriptAlias / {{ binary_path }}/python3-keystone-wsgi-public +{% else %} WSGIScriptAlias / {{ binary_path }}/keystone-wsgi-public +{% endif %} WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On = 2.4> @@ -34,7 +42,11 @@ TraceEnable off WSGIDaemonProcess keystone-admin processes={{ openstack_service_workers }} threads=1 user=keystone group=keystone display-name=%{GROUP} python-path={{ python_path }} WSGIProcessGroup keystone-admin +{% if kolla_install_type == 'binary' and kolla_base_distro == 'ubuntu' %} + WSGIScriptAlias / {{ binary_path }}/python3-keystone-wsgi-admin +{% else %} WSGIScriptAlias / {{ binary_path }}/keystone-wsgi-admin +{% endif %} WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On = 2.4> diff --git a/ansible/roles/nova/templates/placement-api-wsgi.conf.j2 b/ansible/roles/nova/templates/placement-api-wsgi.conf.j2 index 7af2e9ae6c..556aa00a1f 100644 --- a/ansible/roles/nova/templates/placement-api-wsgi.conf.j2 +++ b/ansible/roles/nova/templates/placement-api-wsgi.conf.j2 @@ -1,5 +1,9 @@ {% set log_dir = '/var/log/kolla/nova' %} -{% set python_path = '/usr/lib/python2.7/site-packages' if nova_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% if nova_install_type == 'binary' %} + {% set python_path = '/usr/lib/python3/dist-packages' if kolla_base_distro == 'ubuntu' else '/usr/lib/python2.7/site-packages' %} +{% else %} + {% set python_path = '/var/lib/kolla/venv/lib/python2.7/site-packages' %} +{% endif %} {% set wsgi_directory = '/usr/bin' if nova_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} Listen {{ api_interface_address }}:{{ placement_api_listen_port }} @@ -10,7 +14,11 @@ TraceEnable off WSGIDaemonProcess placement-api processes={{ openstack_service_workers }} threads=1 user=nova group=nova display-name=%{GROUP} python-path={{ python_path }} WSGIProcessGroup placement-api +{% if kolla_install_type == 'binary' and kolla_base_distro == 'ubuntu' %} + WSGIScriptAlias / {{ wsgi_directory }}/python3-nova-placement-api +{% else %} WSGIScriptAlias / {{ wsgi_directory }}/nova-placement-api +{% endif %} WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On = 2.4> @@ -20,7 +28,11 @@ TraceEnable off 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 +{% if kolla_install_type == 'binary' and kolla_base_distro == 'ubuntu' %} + +{% else %} +{% endif %} Require all granted