From 0f3b90c23ece2bcaf7385f85082d946dd76189a4 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 1 Jun 2018 17:27:18 +0100 Subject: [PATCH] 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 --- test-install-keystone.yml | 16 ++++++---------- test-vars.yml | 2 -- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/test-install-keystone.yml b/test-install-keystone.yml index 9b60db6a..b07cb680 100644 --- a/test-install-keystone.yml +++ b/test-install-keystone.yml @@ -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 diff --git a/test-vars.yml b/test-vars.yml index 16558e3f..bf01bfc7 100644 --- a/test-vars.yml +++ b/test-vars.yml @@ -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