Add customizations for keystone

Adds customizations for keystone.

Change-Id: I970e690539388e05f974f92b1e20710cc8de37ed
Partially-Implements: blueprint third-party-plugin-support
This commit is contained in:
Naren Narendra 2016-08-01 19:15:50 -04:00
parent 6d6cf1dc4c
commit edcb218a19

View File

@ -1,16 +1,19 @@
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %} {% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
{% set keystone_packages = [
'openstack-keystone',
'python-keystoneclient',
'httpd',
'mod_wsgi',
'python-ldappool'
] %}
RUN yum -y install openstack-keystone \ RUN {{ macros.install_packages(keystone_packages | customizable("packages")) }}
python-keystoneclient \
httpd \
mod_wsgi \
python-ldappool \
&& yum clean all
RUN mkdir -p /var/www/cgi-bin/keystone \ RUN mkdir -p /var/www/cgi-bin/keystone \
&& cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/main \ && cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/main \
&& cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/admin \ && cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/admin \
@ -18,13 +21,14 @@ RUN mkdir -p /var/www/cgi-bin/keystone \
{% elif base_distro in ['ubuntu'] %} {% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \ {% set keystone_packages = [
keystone \ 'keystone',
apache2 \ 'apache2',
libapache2-mod-wsgi \ 'libapache2-mod-wsgi',
python-ldappool \ 'python-ldappool'
&& apt-get clean ] %}
RUN {{ macros.install_packages(keystone_packages | customizable("packages")) }}
RUN mkdir -p /var/www/cgi-bin/keystone \ RUN mkdir -p /var/www/cgi-bin/keystone \
&& cp -a /usr/share/keystone/wsgi.py /var/www/cgi-bin/keystone/main \ && cp -a /usr/share/keystone/wsgi.py /var/www/cgi-bin/keystone/main \
&& cp -a /usr/share/keystone/wsgi.py /var/www/cgi-bin/keystone/admin \ && cp -a /usr/share/keystone/wsgi.py /var/www/cgi-bin/keystone/admin \
@ -34,24 +38,25 @@ RUN mkdir -p /var/www/cgi-bin/keystone \
{% elif install_type == 'source' %} {% elif install_type == 'source' %}
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %} {% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
RUN yum -y install \ {% set keystone_packages = [
httpd \ 'httpd',
mod_wsgi \ 'mod_wsgi',
python-ldappool \ 'python-ldappool'
&& yum clean all \ ] %}
&& sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf RUN {{ macros.install_packages(keystone_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
{% elif base_distro in ['ubuntu', 'debian'] %} {% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \ {% set keystone_packages = [
apache2 \ 'apache2',
libapache2-mod-wsgi \ 'libapache2-mod-wsgi',
python-ldappool \ 'python-ldappool'
&& echo > /etc/apache2/ports.conf \ ] %}
&& apt-get clean RUN {{ macros.install_packages(keystone_packages | customizable("packages")) }}
RUN echo > /etc/apache2/ports.conf
{% endif %} {% endif %}
ADD keystone-archive /keystone-source ADD keystone-archive /keystone-source
RUN ln -s keystone-source/* keystone \ RUN ln -s keystone-source/* keystone \
&& useradd --user-group keystone \ && useradd --user-group keystone \
@ -72,4 +77,7 @@ COPY keystone_bootstrap.sh /usr/local/bin/kolla_keystone_bootstrap
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_keystone_bootstrap RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_keystone_bootstrap
{% block keystone_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}