Add nova-placement-api container

Change-Id: I30efc20e6d918e08860584c017455e6d5fa91a35
Closes-Bug: #1660987
This commit is contained in:
Jeffrey Zhang 2017-02-01 22:01:34 +08:00 committed by Jeffrey Zhang
parent 4abfebaad3
commit 4a5f53eea1
2 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,59 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% block nova_placement_api_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set nova_placement_api_packages = [
'httpd',
'mod_wsgi',
'openstack-nova-placement-api'
] %}
{{ macros.install_packages(nova_placement_api_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
{% elif base_distro in ['ubuntu'] %}
{% set nova_placement_api_packages = [
'apache2',
'libapache2-mod-wsgi',
'nova-placement-api'
] %}
{{ macros.install_packages(nova_placement_api_packages | customizable("packages")) }}
RUN truncate -s 0 /etc/apache2/ports.conf
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set nova_placement_api_packages = [
'httpd',
'mod_wsgi'
] %}
{{ macros.install_packages(nova_placement_api_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
{% elif base_distro in ['ubuntu'] %}
{% set nova_placement_api_packages = [
'apache2',
'libapache2-mod-wsgi'
] %}
{{ macros.install_packages(nova_placement_api_packages | customizable("packages")) }}
RUN truncate -s 0 /etc/apache2/ports.conf
{% endif %}
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_nova_extend_start
RUN chmod 755 /usr/local/bin/kolla_nova_extend_start
{% block nova_placement_api_footer %}{% endblock %}
{% block footer %}{% endblock %}

View File

@ -0,0 +1,11 @@
#!/bin/bash
# NOTE(pbourke): httpd will not clean up after itself in some cases which
# results in the container not being able to restart. (bug #1489676, 1557036)
if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
# Loading Apache2 ENV variables
source /etc/apache2/envvars
rm -rf /var/run/apache2/*
else
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
fi