From 332a0be8efd3f89bdc1a41b7056ee33bea1a3694 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 1 Jun 2018 18:59:13 +0100 Subject: [PATCH] Move database creation into role (nova) 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: Id43563435631789d7837a7f28cdc971e44b04344 Depends-On: https://review.openstack.org/571785 Depends-On: https://review.openstack.org/574834 --- inventory/group_vars/nova_all.yml | 9 --------- playbooks/os-nova-install.yml | 31 +------------------------------ 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/inventory/group_vars/nova_all.yml b/inventory/group_vars/nova_all.yml index d0082871fc..ef3b43d4a2 100644 --- a/inventory/group_vars/nova_all.yml +++ b/inventory/group_vars/nova_all.yml @@ -36,15 +36,6 @@ nova_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups[' # If there are any Barbican hosts in the environment, then enable its usage nova_barbican_enabled: "{{ hostvars['localhost']['nova_barbican_enabled'] }}" -# The MySQL details for the nova service -nova_galera_user: nova -nova_galera_database: nova -nova_galera_address: "{{ galera_address }}" -nova_api_galera_user: nova_api -nova_api_galera_database: nova_api -nova_api_galera_address: "{{ galera_address }}" -nova_cell0_database: nova_cell0 - nova_external_ssl: "{{ openstack_external_ssl }}" nova_ceph_client_uuid: '{{ cinder_ceph_client_uuid | default() }}' nova_dhcp_domain: "{{ dhcp_domain }}" diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index 00c1d1d444..a96c92a041 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-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: nova_conductor gather_facts: no user: root @@ -44,35 +44,6 @@ - groups[nova_oslomsg_notify_host_group] | length > 0 run_once: yes - - name: Configure MySQL user (nova) - include: common-tasks/mysql-db-user.yml - vars: - user_name: "{{ nova_galera_user }}" - password: "{{ nova_container_mysql_password }}" - login_host: "{{ nova_galera_address }}" - db_name: "{{ nova_galera_database }}" - run_once: yes - - - name: Configure MySQL user (nova-api) - include: common-tasks/mysql-db-user.yml - vars: - user_name: "{{ nova_api_galera_user }}" - password: "{{ nova_api_container_mysql_password }}" - login_host: "{{ nova_api_galera_address }}" - db_name: "{{ nova_api_galera_database }}" - db_append_privs: "yes" - run_once: yes - - - name: Configure MySQL user (nova-api cell0) - include: common-tasks/mysql-db-user.yml - vars: - user_name: "{{ nova_api_galera_user }}" - password: "{{ nova_api_container_mysql_password }}" - login_host: "{{ nova_api_galera_address }}" - db_name: "{{ nova_cell0_database }}" - db_append_privs: "yes" - run_once: yes - - name: Install nova-conductor services