8a1bee4087
With dynamic, i mean that it is retreived from the database host
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
# Build and install a docker image for keystone.
|
|
---
|
|
- include: ../common/tasks/docker.yml
|
|
|
|
- name: Make build and persistent directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: 0777
|
|
with_items:
|
|
- /srv/keystone
|
|
- /srv/keystone/fernet-keys
|
|
|
|
- name: install Dockerfile
|
|
copy:
|
|
src: files/
|
|
dest: /srv/keystone
|
|
|
|
- name: build keystone image
|
|
docker_image:
|
|
path: /srv/keystone
|
|
name: hpc/keystone
|
|
|
|
- name: install service file.
|
|
template:
|
|
src: templates/keystone.service
|
|
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
|
|
|
|
- name: Initialize db
|
|
script: scripts/initialize_db.sh
|
|
|
|
- name: keystone manage commands to setup db
|
|
command: >
|
|
/usr/bin/docker run --rm
|
|
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
|
|
-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
|