Fix cinder-api ubuntu binary deploy

This changes moves cinder-api to make use of apache to
launch its processes.
Ubuntu binary removed support in Ocata for cinder-api
system services [1]. At this moment cinder in Ocata branch
is not working at all due this issue.

This changes aims to fix cinder in master only for ubuntu
binary with the purpose of make a clean backport to stable/ocata
without do any other change on the backport process.
A follow up change will migrate other OS/install_type to make use
of Apache but only changing master branch.

[1] http://lists.openstack.org/pipermail/openstack-dev/2017-January/111069.html

Change-Id: I9885d6acadbac1da46844f583e7cd37785505ae0
Closes-Bug: #1676751
This commit is contained in:
Eduardo Gonzalez 2017-04-19 10:59:44 +01:00 committed by egonzalez90
parent e93ca5c0b6
commit ba78082e0c
5 changed files with 47 additions and 3 deletions

View File

@ -21,6 +21,9 @@
or cinder_conf.changed | bool or cinder_conf.changed | bool
or policy_json.changed | bool or policy_json.changed | bool
or cinder_api_container.changed | bool or cinder_api_container.changed | bool
or (kolla_base_distro in ['debian', 'ubuntu']
and kolla_install_type == 'binary'
and wsgi_cinder_api | changed)
- name: Restart cinder-scheduler container - name: Restart cinder-scheduler container
vars: vars:

View File

@ -24,6 +24,25 @@
- Restart cinder-volume container - Restart cinder-volume container
- Restart cinder-backup container - Restart cinder-backup container
- name: Copying over cinder-wsgi.conf
vars:
service: "{{ cinder_services['cinder-api'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/cinder-api/cinder-wsgi.conf"
with_first_found:
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/cinder-wsgi.conf"
- "{{ node_custom_config }}/cinder/cinder-wsgi.conf"
- "cinder-wsgi.conf.j2"
register: wsgi_cinder_api
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
- kolla_base_distro in ['debian', 'ubuntu']
- kolla_install_type == 'binary'
notify:
- Restart cinder-api container
- name: Copying over cinder.conf - name: Copying over cinder.conf
merge_configs: merge_configs:
vars: vars:

View File

@ -1,5 +1,6 @@
{% set command = '/usr/sbin/apache2 -DFOREGROUND' if kolla_base_distro in ['ubuntu', 'debian'] and kolla_install_type == 'binary' else 'cinder-api --config-file /etc/cinder/cinder.conf' %}
{ {
"command": "cinder-api --config-file /etc/cinder/cinder.conf", "command": "{{ command }}",
"config_files": [ "config_files": [
{ {
"source": "{{ container_config_directory }}/cinder.conf", "source": "{{ container_config_directory }}/cinder.conf",
@ -13,7 +14,13 @@
"owner": "cinder", "owner": "cinder",
"perm": "0600", "perm": "0600",
"optional": true "optional": true
} }{% if kolla_base_distro in ['ubuntu', 'debian'] and kolla_install_type == 'binary' %},
{
"source": "{{ container_config_directory }}/cinder-wsgi.conf",
"dest": "/etc/apache2/conf-enabled/cinder-wsgi.conf",
"owner": "cinder",
"perm": "0600"
}{% endif %}
], ],
"permissions": [ "permissions": [
{ {

View File

@ -0,0 +1,15 @@
{% set python_path = '/usr/lib/python2.7/site-packages' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %}
Listen {{ api_interface_address }}:{{ cinder_api_port }}
<VirtualHost *:{{ cinder_api_port }}>
WSGIDaemonProcess cinder-api processes={{ openstack_service_workers }} threads=1 user=cinder group=cinder display-name=%{GROUP} python-path={{ python_path }}
WSGIProcessGroup cinder-api
WSGIScriptAlias / /var/www/cgi-bin/cinder/cinder-wsgi
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog /var/log/kolla/cinder/cinder-api.log
CustomLog /var/log/kolla/cinder/cinder-api-access.log combined
</VirtualHost>

View File

@ -1,7 +1,7 @@
<match kolla.var.log.kolla.*.*.log> <match kolla.var.log.kolla.*.*.log>
@type rewrite_tag_filter @type rewrite_tag_filter
capitalize_regex_backreference yes capitalize_regex_backreference yes
rewriterule1 programname ^(horizon-access|ceilometer-api-access|keystone-apache-admin-access|keystone-apache-public-access)$ apache_access rewriterule1 programname ^(horizon-access|ceilometer-api-access|keystone-apache-admin-access|keystone-apache-public-access|cinder-api-access)$ apache_access
rewriterule2 programname ^aodh_wsgi_access$ wsgi_access rewriterule2 programname ^aodh_wsgi_access$ wsgi_access
rewriterule3 programname ^(nova-api|nova-compute|nova-conductor|nova-consoleauth|nova-manage|nova-novncproxy|nova-scheduler|nova-placement-api|placement-api|placement-api-access|privsep-helper).* openstack_python rewriterule3 programname ^(nova-api|nova-compute|nova-conductor|nova-consoleauth|nova-manage|nova-novncproxy|nova-scheduler|nova-placement-api|placement-api|placement-api-access|privsep-helper).* openstack_python
rewriterule4 programname ^(sahara-api|sahara-engine).* openstack_python rewriterule4 programname ^(sahara-api|sahara-engine).* openstack_python