aboutsummaryrefslogtreecommitdiff
path: root/docker/keystone/keystone-base
diff options
context:
space:
mode:
authorShaun Smekel <shaun.smekel@theorem.net.au>2016-08-05 07:44:42 +1000
committerShaun Smekel <shaun.smekel@theorem.net.au>2016-08-25 20:13:02 +1000
commit524868c632b23385145d140e5e6abab82cda50cf (patch)
tree0e9b67ec49047c8a849c261a629942b9a7a6a60c /docker/keystone/keystone-base
parent1e222274e155d6db11c80aee4c48d9e5f3713e22 (diff)
downloadkolla-524868c632b23385145d140e5e6abab82cda50cf.tar.gz
kolla-524868c632b23385145d140e5e6abab82cda50cf.zip
Add dockerfiles for keystone fernet
This adds the docker aspects of fernet key bootstrapping as well as distributed key rotation. - Bootstrapping is handled in the same way as keystone bootstrap. - A new keystone-fernet and keystone-ssh container is created to allow the nodes to communicate with each other (taken from nova-ssh). - The keystone-fernet is a keystone container with crontab installed. This will handle key rotations through keystone-manage and trigger an rsync to push new tokens to other nodes. The Ansible component is implemented in: https://review.openstack.org/#/c/349366 Change-Id: Id610e00e8c63c7f1bc0974c0aa1b3f44c18e1019 Partially-Implements: blueprint keystone-fernet-token Partially-Implements: blueprint third-party-plugin-support
Diffstat (limited to 'docker/keystone/keystone-base')
-rw-r--r--docker/keystone/keystone-base/Dockerfile.j276
1 files changed, 76 insertions, 0 deletions
diff --git a/docker/keystone/keystone-base/Dockerfile.j2 b/docker/keystone/keystone-base/Dockerfile.j2
new file mode 100644
index 000000000..336437732
--- /dev/null
+++ b/docker/keystone/keystone-base/Dockerfile.j2
@@ -0,0 +1,76 @@
+FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+{% import "macros.j2" as macros with context %}
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['fedora', '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/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/main \
+ && cp -a /usr/share/keystone/keystone.wsgi /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/share/keystone/wsgi.py /var/www/cgi-bin/keystone/main \
+ && cp -a /usr/share/keystone/wsgi.py /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 ['fedora', '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 %}
+
+ADD keystone-base-archive /keystone-base-source
+RUN ln -s keystone-base-source/* keystone \
+ && useradd --user-group 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 /home/keystone \
+ && 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 /home/keystone
+
+{% 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 }} \ No newline at end of file