From e58e677d472d25ba86b1d79fe6c016e619c7a451 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Date: Tue, 9 May 2017 13:36:25 +0200 Subject: [PATCH] Migrate cinder-api under apache Cinder-api in ubuntu binary was migrated under apache because ubuntu packages removed support to system services. This change migrate other install_types under apache to unify all types. Change-Id: Iad6792142019134513a378a7ad9955888ef320e9 --- docker/cinder/cinder-api/Dockerfile.j2 | 24 +++++++++++-------- .../cinder-api-wsgi-b6124980d9ce9ae4.yaml | 5 ++++ 2 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 tools/releasenotes/notes/cinder-api-wsgi-b6124980d9ce9ae4.yaml diff --git a/docker/cinder/cinder-api/Dockerfile.j2 b/docker/cinder/cinder-api/Dockerfile.j2 index 790f822869..07e4a7c488 100644 --- a/docker/cinder/cinder-api/Dockerfile.j2 +++ b/docker/cinder/cinder-api/Dockerfile.j2 @@ -14,8 +14,11 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build 'python-keystone' ] %} {{ macros.install_packages(cinder_api_packages | customizable("packages")) }} -RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ +RUN mkdir -p /var/www/cgi-bin/cinder \ + && cp -a /usr/bin/cinder-wsgi /var/www/cgi-bin/cinder/cinder-wsgi \ + && sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf + {% elif base_distro in ['debian', 'ubuntu'] %} {% set cinder_api_packages = [ 'apache2', @@ -29,6 +32,7 @@ RUN mkdir -p /var/www/cgi-bin/cinder \ {% endif %} {% elif install_type == 'source' %} + {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} {% set cinder_api_packages = [ 'httpd', @@ -38,26 +42,26 @@ RUN mkdir -p /var/www/cgi-bin/cinder \ {{ macros.install_packages(cinder_api_packages | customizable("packages")) }} RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf - {% elif base_distro in ['debian', 'ubuntu'] %} + + {% elif base_distro in ['ubuntu'] %} {% set cinder_api_packages = [ 'apache2', 'libapache2-mod-wsgi' ] %} {{ macros.install_packages(cinder_api_packages | customizable("packages")) }} RUN echo > /etc/apache2/ports.conf + {% endif %} +RUN mkdir -p /var/www/cgi-bin/cinder \ + && cp -a /var/lib/kolla/venv/bin/cinder-wsgi /var/www/cgi-bin/cinder/cinder-wsgi + {% endif %} COPY extend_start.sh /usr/local/bin/kolla_cinder_extend_start -RUN chmod 755 /usr/local/bin/kolla_cinder_extend_start +RUN chmod 755 /usr/local/bin/kolla_cinder_extend_start \ + && chown -R cinder: /var/www/cgi-bin/cinder \ + && chmod 755 /var/www/cgi-bin/cinder/cinder-wsgi {% block cinder_api_footer %}{% endblock %} {% block footer %}{% endblock %} - -{% if install_type == 'binary' and base_distro in ['debian', 'ubuntu'] %} -RUN chown -R cinder: /var/www/cgi-bin/cinder \ - && chmod 755 /var/www/cgi-bin/cinder/cinder-wsgi -{% else %} -USER cinder -{% endif %} diff --git a/tools/releasenotes/notes/cinder-api-wsgi-b6124980d9ce9ae4.yaml b/tools/releasenotes/notes/cinder-api-wsgi-b6124980d9ce9ae4.yaml new file mode 100644 index 0000000000..c36afd426c --- /dev/null +++ b/tools/releasenotes/notes/cinder-api-wsgi-b6124980d9ce9ae4.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Cinder-api service has been migrated under + Apache wsgi process.