2017-04-25 14:47:04 +02:00
|
|
|
# Build and install a docker image for keystone.
|
|
|
|
---
|
|
|
|
- include: ../common/tasks/docker.yml
|
|
|
|
|
2017-05-11 15:55:05 +02:00
|
|
|
- name: Make build and persistent directories
|
2017-04-25 14:47:04 +02:00
|
|
|
file:
|
2017-05-11 15:55:05 +02:00
|
|
|
path: "{{ item }}"
|
2017-04-25 14:47:04 +02:00
|
|
|
state: directory
|
2017-05-11 15:55:05 +02:00
|
|
|
mode: 0777
|
|
|
|
with_items:
|
|
|
|
- /srv/keystone
|
|
|
|
- /srv/keystone/fernet-keys
|
2017-04-25 14:47:04 +02:00
|
|
|
|
|
|
|
- name: install Dockerfile
|
|
|
|
copy:
|
2017-05-11 15:55:05 +02:00
|
|
|
src: files/
|
2017-04-25 14:47:04 +02:00
|
|
|
dest: /srv/keystone
|
|
|
|
|
|
|
|
- name: build keystone image
|
|
|
|
docker_image:
|
|
|
|
path: /srv/keystone
|
|
|
|
name: hpc/keystone
|
|
|
|
|
|
|
|
- name: install service file.
|
|
|
|
template:
|
2017-05-11 16:47:03 +02:00
|
|
|
src: templates/keystone.service
|
2017-04-25 14:47:04 +02:00
|
|
|
dest: /etc/systemd/system/keystone.service
|
|
|
|
mode: 644
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
|
|
|
|
- name: install service file
|
|
|
|
command: systemctl daemon-reload
|
|
|
|
|
|
|
|
- name: make sure service is started
|
|
|
|
systemd:
|
|
|
|
name: keystone.service
|
|
|
|
state: started
|
2017-05-11 15:55:05 +02:00
|
|
|
|
|
|
|
- name: Initialize db
|
|
|
|
script: scripts/initialize_db.sh
|
|
|
|
|
|
|
|
- name: keystone manage commands to setup db
|
|
|
|
command: >
|
2017-05-11 16:47:03 +02:00
|
|
|
/usr/bin/docker run --rm
|
|
|
|
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
|
2017-05-11 15:55:05 +02:00
|
|
|
-v /srv/keystone/fernet-keys:/etc/keystone/fernet-keys
|
|
|
|
hpc/keystone keystone-manage {{ item }}
|
|
|
|
with_items:
|
|
|
|
- db_sync
|
|
|
|
- fernet_setup --keystone-user keystone --keystone-group keystone
|
|
|
|
- credential_setup --keystone-user keystone --keystone-group keystone
|
|
|
|
- >
|
|
|
|
bootstrap --bootstrap-password geheim
|
|
|
|
--bootstrap-admin-url http://localhost:35357/v3/
|
|
|
|
--bootstrap-internal-url http://localhost:35357/v3/
|
|
|
|
--bootstrap-public-url http://localhost:5000/v3/
|
|
|
|
--bootstrap-region-id RegionOne
|