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 ansible-test
[keystone] [keystone]
ansible-test ansible-test
[registry]
ansible-test

View File

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

View File

@ -4,28 +4,14 @@
# run keystone-manage db_sync from this docker first: # run keystone-manage db_sync from this docker first:
# $ docker run hpc/keystone --add-host=mariadb:<ip mariadb> "keystone-manage db_sync" # $ 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 apt-get update
RUN git clone https://git.openstack.org/openstack/keystone.git -b stable/ocata
# all furter commands are done from /keystone directory. RUN apt-get install --yes keystone
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/
# configure keystone to connect to mariadb host. # 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 # set admin token TODO: make this a secret
RUN sed -i 's/#admin_token = ADMIN/admin_token = SuperSecreteKeystoneToken/g' /etc/keystone/keystone.conf 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 mkdir /etc/keystone/fernet-keys
#RUN keystone-manage db_sync #RUN keystone-manage db_sync
CMD keystone-manage fernet_setup --keystone-user root --keystone-group root && \ CMD apachectl -DFOREGROUND
uwsgi --http 127.0.0.1:35357 --wsgi-file /usr/local/bin/keystone-wsgi-admin

View File

@ -8,7 +8,7 @@ TimeoutStartSec=0
Restart=always Restart=always
ExecStartPre=-/usr/bin/docker stop %n ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -14,3 +14,8 @@
systemd: systemd:
name: mysql.service name: mysql.service
state: started 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