From 19fde37937513b58bcab843b9593a56064fcb7e4 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 1 Jun 2018 14:47:10 +0100 Subject: [PATCH] Move database creation into role (cinder) 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 group_vars which were duplicated from the role, and remove the DB setup tasks as they are no longer required. Change-Id: I3127dd5ed980a41ac013757c78626e20ad62f93e Depends-On: https://review.openstack.org/571724 --- inventory/group_vars/cinder_all.yml | 5 ----- playbooks/os-cinder-install.yml | 11 +---------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/inventory/group_vars/cinder_all.yml b/inventory/group_vars/cinder_all.yml index 0b711a9e31..5faee150ff 100644 --- a/inventory/group_vars/cinder_all.yml +++ b/inventory/group_vars/cinder_all.yml @@ -61,11 +61,6 @@ cinder_rabbitmq_telemetry_host_group: "{{ cinder_rabbitmq_host_group }}" # If there are any Ceilometer hosts in the environment, then enable its usage cinder_ceilometer_enabled: "{{ (groups['cinder_all'] is defined) and (groups['cinder_all'] | length > 0) and (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" -# The MySQL details for the cinder service -cinder_galera_user: cinder -cinder_galera_database: cinder -cinder_galera_address: "{{ galera_address }}" - # The address used to listen for communications cinder_management_address: "{{ ansible_host }}" diff --git a/playbooks/os-cinder-install.yml b/playbooks/os-cinder-install.yml index 21a97e0f38..0d3f8e8be8 100644 --- a/playbooks/os-cinder-install.yml +++ b/playbooks/os-cinder-install.yml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Prepare MQ/DB services +- name: Prepare MQ services hosts: cinder_all gather_facts: no user: root @@ -66,15 +66,6 @@ - groups[cinder_oslomsg_notify_host_group] | length > 0 run_once: yes - - name: Configure MySQL user - include: common-tasks/mysql-db-user.yml - vars: - user_name: "{{ cinder_galera_user }}" - password: "{{ cinder_container_mysql_password }}" - login_host: "{{ cinder_galera_address }}" - db_name: "{{ cinder_galera_database }}" - run_once: yes - - name: Install cinder scheduler services