From bd185e2ba623a560521ffd96f97d1af72fb03c72 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 15 May 2018 08:33:41 +0100 Subject: [PATCH] Move database creation into role (glance) 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: I759783e7cad55c0b2f91df6faf53e9fb7896da6b Depends-On: https://review.openstack.org/568481 --- inventory/group_vars/glance_all.yml | 5 ----- playbooks/os-glance-install.yml | 11 +---------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/inventory/group_vars/glance_all.yml b/inventory/group_vars/glance_all.yml index fa71d69e06..4f726319f9 100644 --- a/inventory/group_vars/glance_all.yml +++ b/inventory/group_vars/glance_all.yml @@ -40,11 +40,6 @@ glance_rabbitmq_telemetry_host_group: "{{ glance_rabbitmq_host_group }}" # If there are any Ceilometer hosts in the environment, then enable its usage glance_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" -# MariaDB details for the glance service -glance_galera_user: glance -glance_galera_database: glance -glance_galera_address: "{{ galera_address }}" - glance_service_region: "{{ service_region }}" glance_service_in_ldap: "{{ service_ldap_backend_enabled }}" diff --git a/playbooks/os-glance-install.yml b/playbooks/os-glance-install.yml index c120205b3d..a40018e0fe 100644 --- a/playbooks/os-glance-install.yml +++ b/playbooks/os-glance-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: glance_all gather_facts: no user: root @@ -64,15 +64,6 @@ - glance_ceilometer_enabled | bool - groups[oslomsg_notify_host_group] | length > 0 - - name: Configure MySQL user - include: common-tasks/mysql-db-user.yml - vars: - user_name: "{{ glance_galera_user }}" - password: "{{ glance_container_mysql_password }}" - login_host: "{{ glance_galera_address }}" - db_name: "{{ glance_galera_database }}" - run_once: yes - - name: Install glance API services