First keystone version

Change-Id: I88dddd1c626de3d1c7ae7ad5e3cfd0c512a43011
This commit is contained in:
Artur Zarzycki 2016-05-17 12:52:45 +02:00
parent 6427eb4216
commit 4e523a56d9
6 changed files with 123 additions and 0 deletions

View File

@ -0,0 +1,37 @@
FROM {{ namespace }}/openstack-base:{{ tag }}
MAINTAINER {{ maintainer }}
#mysql-client only for provisioning need to be removed later
RUN apt-get install -y --no-install-recommends \
apache2 \
libapache2-mod-wsgi \
mysql-client \
&& echo > /etc/apache2/ports.conf \
&& apt-get clean
RUN curl -o keystone-{{ branch }}.tar.gz http://tarballs.openstack.org/keystone/keystone-{{ branch }}.tar.gz \
&& tar -zxvf keystone-{{ branch }}.tar.gz
RUN mv keystone*/ keystone-{{ branch }}/ \
&& ln -s keystone-{{ branch }} /keystone \
&& useradd --user-group keystone \
&& /var/lib/microservices/venv/bin/pip --no-cache-dir install --upgrade -c /keystone/requirements.txt /keystone \
&& mkdir -p /etc/keystone /var/www/cgi-bin/keystone /var/log/apache2 /home/keystone \
&& cp -r /keystone/etc/* /etc/keystone/ \
&& cp /keystone/httpd/keystone.py /var/www/cgi-bin/keystone/admin \
&& cp /keystone/httpd/keystone.py /var/www/cgi-bin/keystone/main \
&& chown -R keystone: /etc/keystone /var/www/cgi-bin/keystone /var/log/apache2 /home/keystone
RUN chown -R keystone: /var/www/cgi-bin/keystone \
&& chmod 755 /var/www/cgi-bin/keystone/*
COPY keystone.conf /etc/keystone/keystone.conf
COPY wsgi-keystone.conf /etc/apache2/conf-enabled/wsgi-keystone.conf
COPY bootstrap.sh /usr/local/bin/bootstrap.sh
RUN chmod 755 /usr/local/bin/bootstrap.sh
CMD ["bootstrap.sh"]

View File

@ -0,0 +1,24 @@
#!/bin/bash
source /etc/apache2/envvars
sed -i "s/keystone_user/${KEYSTONE_USER}/g" /etc/keystone/keystone.conf
sed -i "s/keystone_pass/${KEYSTONE_PASS}/g" /etc/keystone/keystone.conf
sed -i "s/keystone_addr/${DB_HOST}/g" /etc/keystone/keystone.conf
sed -i "s/keystone_db/${KEYSTONE_DB}/g" /etc/keystone/keystone.conf
# bootstrap db
mysql -u root -p${ROOT_DB_PASS} -h ${DB_HOST} -e 'create database keystone'
mysql -u root -p${ROOT_DB_PASS} -h ${DB_HOST} -e "grant all privileges on keystone.* to '${KEYSTONE_USER}'@'%' identified by '${KEYSTONE_PASS}';"
keystone-manage db_sync
keystone-manage bootstrap --bootstrap-password ${KEYSTONE_PASS}
export OS_URL=http://127.0.0.1:35357/v3
export OS_TOKEN=adm_tok
export OS_IDENTITY_API_VERSION=3
openstack service create --name keystone --description "OpenStack Identity" identity
/usr/sbin/apache2ctl -D FOREGROUND

View File

@ -0,0 +1,9 @@
[DEFAULT]
debug = true
syslog_log_facility=LOG_LOCAL0
use_syslog = True
admin_token = adm_tok
[database]
connection = mysql+pymysql://keystone_user:keystone_pass@keystone_addr/keystone_db

View File

@ -0,0 +1,28 @@
Listen 5000
Listen 35357
<VirtualHost *:5000>
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP} python-path=/var/lib/microservices/venv/lib/python2.7/site-packages
WSGIProcessGroup keystone-public
WSGIScriptAlias / /var/www/cgi-bin/keystone/main
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog "|/usr/bin/logger -t keystone-error"
CustomLog "|/usr/bin/logger -t keystone-access" combined
</VirtualHost>
<VirtualHost *:35357>
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP} python-path=/var/lib/microservices/venv/lib/python2.7/site-packages
WSGIProcessGroup keystone-admin
WSGIScriptAlias / /var/www/cgi-bin/keystone/admin
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
ErrorLog "|/usr/bin/logger -t keystone-error"
CustomLog "|/usr/bin/logger -t keystone-access" combined
</VirtualHost>

View File

@ -0,0 +1,9 @@
#!/bin/bash
### Temp docker syntax checker script. Doesnt really check something...
set -e
for file in $(find . -name 'Dockerfile.j2')
do
fgrep -q FROM $file || echo 'Miss/ wrong FROM section in file' $file
fgrep -q MAINTAINER $file || echo 'Miss/ wrong MAINTAINER section in file' $file
done

16
tox.ini Normal file
View File

@ -0,0 +1,16 @@
[tox]
minversion = 1.6
envlist = py34,py27,pypy,pep8
skipsdist = True
[testenv:linters]
commands =
{toxinidir}/tools/run-check-docker-syntax.sh
[testenv:pep8]
commands =
{toxinidir}/tools/run-check-docker-syntax.sh
[testenv:bashate]
commands =
{toxinidir}/tools/run-check-docker-syntax.sh