2017-04-25 14:47:04 +02:00
|
|
|
# Build and install a docker image for keystone.
|
|
|
|
---
|
2017-07-24 12:17:50 +02:00
|
|
|
- name: Make persistent directories
|
2017-04-25 14:47:04 +02:00
|
|
|
file:
|
2017-07-24 12:17:50 +02:00
|
|
|
path: /srv/keystone/fernet-keys
|
2017-04-25 14:47:04 +02:00
|
|
|
state: directory
|
2017-05-11 15:55:05 +02:00
|
|
|
mode: 0777
|
2017-04-25 14:47:04 +02:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2017-05-11 15:55:05 +02:00
|
|
|
- name: Initialize db
|
2017-06-14 10:58:38 +02:00
|
|
|
script: scripts/initialize_db.sh {{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
|
2017-05-11 15:55:05 +02:00
|
|
|
|
|
|
|
- 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
|
2017-07-24 12:17:50 +02:00
|
|
|
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
|
2017-05-11 15:55:05 +02:00
|
|
|
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
|
2017-06-16 16:33:45 +02:00
|
|
|
--bootstrap-admin-url http://{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}:35357/v3/
|
|
|
|
--bootstrap-internal-url http://{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}:35357/v3/
|
|
|
|
--bootstrap-public-url http://{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}:5000/v3/
|
2017-05-11 15:55:05 +02:00
|
|
|
--bootstrap-region-id RegionOne
|
2017-06-16 16:33:45 +02:00
|
|
|
|
2017-07-12 10:19:45 +02:00
|
|
|
- name: Create a domain, projects users and roles
|
|
|
|
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
|
2017-07-24 12:17:50 +02:00
|
|
|
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
|
2017-07-12 10:19:45 +02:00
|
|
|
hpc/keystone bash /etc/bootstrap.sh
|
|
|
|
|
|
|
|
- name: make sure service is started
|
|
|
|
systemd:
|
|
|
|
name: keystone.service
|
|
|
|
state: restarted
|