Move database creation into role (keystone)

There is no record for why we implement the database creation outside
of the role in the playbook, when we could do it inside the role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we remove the test-vars which were duplicated from the
role, and remove the DB setup tasks as they are no longer required.

Change-Id: I2d313410fa79184f77e6f8331e27cacc498878ba
Depends-On: https://review.openstack.org/571774
This commit is contained in:
Jesse Pretorius 2018-06-01 17:27:18 +01:00
parent 287c890584
commit 0f3b90c23e
2 changed files with 6 additions and 12 deletions

View File

@ -19,6 +19,8 @@
any_errors_fatal: true
user: root
become: true
vars_files:
- test-vars.yml
tasks:
- name: Set keystone_messaging fact
set_fact:
@ -44,12 +46,6 @@
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"
- include: create-grant-db.yml
db_name: "{{ keystone_galera_database }}"
db_password: "{{ keystone_container_mysql_password }}"
vars_files:
- test-vars.yml
- name: Playbook for deploying keystone
hosts: keystone_all
serial: 1
@ -57,6 +53,8 @@
become: true
gather_facts: true
any_errors_fatal: true
vars_files:
- test-vars.yml
pre_tasks:
# In order to ensure that any container, software or
# config file changes which causes a container/service
@ -78,8 +76,6 @@
haproxy_state: enabled
when:
- "groups['keystone_all'] | length > 1"
vars_files:
- test-vars.yml
- name: Playbook for finalising the keystone db migrations
hosts: keystone_all[0]
@ -87,6 +83,8 @@
become: true
gather_facts: false
any_errors_fatal: true
vars_files:
- test-vars.yml
tasks:
- name: Perform a Keystone DB sync contract
command: keystone-manage db_sync --contract
@ -96,5 +94,3 @@
PATH: "/openstack/venvs/keystone-{{ keystone_venv_tag }}/bin:{{ ansible_env.PATH }}"
tags:
- skip_ansible_lint
vars_files:
- test-vars.yml

View File

@ -149,8 +149,6 @@ keystone_rabbitmq_servers: "{{ rabbitmq_servers }}"
keystone_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
keystone_rabbitmq_userid: keystone
keystone_rabbitmq_vhost: /keystone
keystone_galera_database: keystone
keystone_galera_address: "{{ test_galera_host }}"
keystone_container_mysql_password: "SuperSecrete"
keystone_venv_tag: "testing"
keystone_developer_mode: true