diff --git a/tasks/db_setup.yml b/tasks/db_setup.yml deleted file mode 100644 index 09b01f8..0000000 --- a/tasks/db_setup.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -# Copyright 2019, VEXXHOST, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# WARNING: -# This file is maintained in the openstack-ansible-tests repository. -# https://git.openstack.org/cgit/openstack/openstack-ansible-tests/tree/sync/tasks/db_setup.yml -# If you need to modify this file, update the one in the openstack-ansible-tests -# repository. Once it merges there, the changes will automatically be proposed to -# all the repositories which use it. - -- name: Setup Database Service (MariaDB) - delegate_to: "{{ _oslodb_setup_host }}" - vars: - ansible_python_interpreter: "{{ _oslodb_ansible_python_interpreter }}" - tags: - - common-mariadb - block: - - name: Create database for service - community.mysql.mysql_db: - name: "{{ item.name }}" - login_host: "{{ _oslodb_setup_endpoint | default(omit) }}" - login_port: "{{ _oslodb_setup_port | default(omit) }}" - loop: "{{ _oslodb_databases }}" - no_log: true - - - name: Grant access to the database for the service - community.mysql.mysql_user: - name: "{{ item.1.username }}" - password: "{{ item.1.password }}" - host: "{{ item.1.host | default('%') }}" - priv: "{{ item.0.name }}.*:{{ item.1.priv | default('ALL') }}" - append_privs: yes - login_host: "{{ _oslodb_setup_endpoint | default(omit) }}" - login_port: "{{ _oslodb_setup_port | default(omit) }}" - loop: "{{ _oslodb_databases | subelements('users') }}" - no_log: true diff --git a/tasks/main.yml b/tasks/main.yml index b986533..3c504d1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -25,8 +25,13 @@ tags: - always -- import_tasks: db_setup.yml - when: inventory_hostname == groups['utility_all'][0] + +- include_role: + name: openstack.osa.db_setup + apply: + tags: + - common-db + - rally-config vars: _oslodb_setup_host: "{{ rally_db_setup_host }}" _oslodb_ansible_python_interpreter: "{{ rally_db_setup_python_interpreter }}" @@ -38,8 +43,7 @@ - username: "{{ rally_galera_user }}" password: "{{ rally_galera_password }}" tags: - - common-db - - rally-config + - always - include_tasks: rally_pre_install.yml tags: