Keystone is now based on ubuntu zesty

This commit is contained in:
Egon Rijpkema 2017-05-10 11:21:17 +02:00
parent be4c1a774c
commit 2401fb2135
5 changed files with 16 additions and 22 deletions

4
hosts
View File

@ -2,5 +2,9 @@
ansible-test
[keystone]
ansible-test
[registry]
ansible-test

View File

@ -12,7 +12,7 @@
- common
- keystone
- hosts: all
- hosts: registry
become: True
roles:
- common

View File

@ -4,28 +4,14 @@
# run keystone-manage db_sync from this docker first:
# $ docker run hpc/keystone --add-host=mariadb:<ip mariadb> "keystone-manage db_sync"
FROM python:2.7
FROM ubuntu:zesty
# Clone the offical keystone repo and checkout ocata.
RUN git clone https://git.openstack.org/openstack/keystone.git -b stable/ocata
RUN apt-get update
# all furter commands are done from /keystone directory.
WORKDIR /keystone
# Install python dependencies
RUN pip install MySQL-python==1.2.5 \
uWSGI==2.0.15 \
requests==2.12
# Install keystone.
RUN pip install .
#Install keystone settings files
RUN mkdir /etc/keystone
RUN cp -R etc/* /etc/keystone/
RUN apt-get install --yes keystone
# configure keystone to connect to mariadb host.
RUN sed "s|database]|database]\nconnection = mysql://keystone:keystone@mariadb/keystone|g" /etc/keystone/keystone.conf.sample > /etc/keystone/keystone.conf
RUN sed -i "s|database]|database]\nconnection = mysql://keystone:keystone@mariadb/keystone|g" /etc/keystone/keystone.conf
# set admin token TODO: make this a secret
RUN sed -i 's/#admin_token = ADMIN/admin_token = SuperSecreteKeystoneToken/g' /etc/keystone/keystone.conf
@ -33,6 +19,5 @@ RUN sed -i 's/#admin_token = ADMIN/admin_token = SuperSecreteKeystoneToken/g' /e
RUN mkdir /etc/keystone/fernet-keys
#RUN keystone-manage db_sync
CMD keystone-manage fernet_setup --keystone-user root --keystone-group root && \
uwsgi --http 127.0.0.1:35357 --wsgi-file /usr/local/bin/keystone-wsgi-admin
CMD apachectl -DFOREGROUND

View File

@ -8,7 +8,7 @@ TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStart=/usr/bin/docker run --name %n --add-host="mariadb:172.29.236.13" hpc/keystone
ExecStart=/usr/bin/docker run --name %n --add-host="mariadb:172.29.236.13" -p 5001:5000 -p 35357:35357 hpc/keystone
[Install]
WantedBy=multi-user.target

View File

@ -14,3 +14,8 @@
systemd:
name: mysql.service
state: started
- name: create keystone db and credentials.
command: echo "create database if not exists keystone; \n
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone'; \n
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone'" \
| mysql -uroot -pgeheim --host 127.0.0.1