82 lines
3.0 KiB
Django/Jinja
82 lines
3.0 KiB
Django/Jinja
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
|
|
MAINTAINER {{ maintainer }}
|
|
|
|
{% block keystone_base_header %}{% endblock %}
|
|
|
|
{% import "macros.j2" as macros with context %}
|
|
|
|
{% if install_type == 'binary' %}
|
|
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
|
|
{% set keystone_base_packages = [
|
|
'openstack-keystone',
|
|
'python-keystoneclient',
|
|
'httpd',
|
|
'mod_wsgi',
|
|
'python-ldappool'
|
|
] %}
|
|
|
|
{{ macros.install_packages(keystone_base_packages | customizable("packages")) }}
|
|
RUN mkdir -p /var/www/cgi-bin/keystone \
|
|
&& cp -a /usr/bin/keystone-wsgi-public /var/www/cgi-bin/keystone/main \
|
|
&& cp -a /usr/bin/keystone-wsgi-admin /var/www/cgi-bin/keystone/admin \
|
|
&& sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
|
|
|
|
{% elif base_distro in ['ubuntu'] %}
|
|
{% set keystone_base_packages = [
|
|
'keystone',
|
|
'apache2',
|
|
'libapache2-mod-wsgi',
|
|
'python-ldappool'
|
|
] %}
|
|
|
|
{{ macros.install_packages(keystone_base_packages | customizable("packages")) }}
|
|
RUN mkdir -p /var/www/cgi-bin/keystone \
|
|
&& cp -a /usr/bin/keystone-wsgi-public /var/www/cgi-bin/keystone/main \
|
|
&& cp -a /usr/bin/keystone-wsgi-admin /var/www/cgi-bin/keystone/admin \
|
|
&& echo > /etc/apache2/ports.conf \
|
|
&& rm /etc/apache2/sites-enabled/keystone.conf
|
|
|
|
{% endif %}
|
|
{% elif install_type == 'source' %}
|
|
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
|
|
{% set keystone_base_packages = [
|
|
'httpd',
|
|
'mod_wsgi',
|
|
'python-ldappool'
|
|
] %}
|
|
{{ macros.install_packages(keystone_base_packages | customizable("packages")) }}
|
|
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
|
|
|
|
{% elif base_distro in ['ubuntu', 'debian'] %}
|
|
{% set keystone_base_packages = [
|
|
'apache2',
|
|
'libapache2-mod-wsgi',
|
|
'python-ldappool'
|
|
] %}
|
|
{{ macros.install_packages(keystone_base_packages | customizable("packages")) }}
|
|
RUN echo > /etc/apache2/ports.conf
|
|
|
|
{% endif %}
|
|
|
|
{% block keystone_source_install %}
|
|
ADD keystone-base-archive /keystone-base-source
|
|
RUN ln -s keystone-base-source/* keystone \
|
|
&& useradd --user-group --create-home --home-dir /var/lib/keystone keystone \
|
|
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /keystone \
|
|
&& mkdir -p /etc/keystone /var/www/cgi-bin/keystone /var/log/apache2 \
|
|
&& cp -r /keystone/etc/* /etc/keystone/ \
|
|
&& cp /var/lib/kolla/venv/bin/keystone-wsgi-admin /var/www/cgi-bin/keystone/admin \
|
|
&& cp /var/lib/kolla/venv/bin/keystone-wsgi-public /var/www/cgi-bin/keystone/main \
|
|
&& chown -R keystone: /etc/keystone /var/www/cgi-bin/keystone /var/log/apache2
|
|
{% endblock %}
|
|
|
|
{% endif %}
|
|
|
|
RUN usermod -a -G kolla keystone \
|
|
&& chown -R keystone: /var/www/cgi-bin/keystone \
|
|
&& chmod 755 /var/www/cgi-bin/keystone/*
|
|
|
|
{% block keystone_base_footer %}{% endblock %}
|
|
{% block footer %}{% endblock %}
|
|
{{ include_footer }}
|