diff --git a/releasenotes/notes/removed-db-create-tasks-8d931286d6347bc6.yaml b/releasenotes/notes/removed-db-create-tasks-8d931286d6347bc6.yaml new file mode 100644 index 00000000..d5c18649 --- /dev/null +++ b/releasenotes/notes/removed-db-create-tasks-8d931286d6347bc6.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - The database create and user creates have been removed + from the ``os_cinder`` role. These tasks have been relocated + to the playbooks. diff --git a/tasks/cinder_db_setup.yml b/tasks/cinder_db_setup.yml index 252c1ecc..a4152c8c 100644 --- a/tasks/cinder_db_setup.yml +++ b/tasks/cinder_db_setup.yml @@ -13,32 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Create DB for service - mysql_db: - login_user: "{{ galera_root_user }}" - login_password: "{{ galera_root_password }}" - login_host: "{{ cinder_galera_address }}" - name: "{{ cinder_galera_database }}" - state: "present" - tags: - - cinder-db-setup - -- name: Grant access to the DB for the service - mysql_user: - login_user: "{{ galera_root_user }}" - login_password: "{{ galera_root_password }}" - login_host: "{{ cinder_galera_address }}" - name: "{{ cinder_galera_user }}" - password: "{{ cinder_container_mysql_password }}" - host: "{{ item }}" - state: "present" - priv: "{{ cinder_galera_database }}.*:ALL" - with_items: - - "localhost" - - "%" - tags: - - cinder-db-setup - - name: Perform a cinder DB sync command: "{{ cinder_bin }}/cinder-manage db sync" become: yes diff --git a/tests/test-install-cinder.yml b/tests/test-install-cinder.yml index 5fa9be1e..21ea9507 100644 --- a/tests/test-install-cinder.yml +++ b/tests/test-install-cinder.yml @@ -35,6 +35,32 @@ state: "present" delegate_to: "10.100.100.2" when: inventory_hostname == groups['cinder_all'][0] + - name: Create DB for service + mysql_db: + login_user: "{{ galera_root_user }}" + login_password: "{{ galera_root_password }}" + login_host: "{{ cinder_galera_address }}" + name: "{{ cinder_galera_database }}" + state: "present" + when: inventory_hostname == groups['cinder_all'][0] + tags: + - mysql-db-setup + - name: Grant access to the DB for the service + mysql_user: + login_user: "{{ galera_root_user }}" + login_password: "{{ galera_root_password }}" + login_host: "{{ cinder_galera_address }}" + name: "{{ cinder_galera_user }}" + password: "{{ cinder_container_mysql_password }}" + host: "{{ item }}" + state: "present" + priv: "{{ cinder_galera_database }}.*:ALL" + when: inventory_hostname == groups['cinder_all'][0] + with_items: + - "localhost" + - "%" + tags: + - mysql-db-setup roles: - role: "{{ rolename | basename }}" vars_files: diff --git a/tests/test-vars.yml b/tests/test-vars.yml index 340e0031..81407481 100644 --- a/tests/test-vars.yml +++ b/tests/test-vars.yml @@ -12,6 +12,8 @@ cinder_profiler_hmac_key: "secrete" cinder_rabbitmq_password: "secrete" cinder_rabbitmq_userid: cinder cinder_rabbitmq_vhost: /cinder +cinder_galera_user: cinder +cinder_galera_database: cinder cinder_requirements_git_install_branch: master cinder_service_password: "secrete" cinder_venv_bin: "/openstack/venvs/cinder-{{ cinder_venv_tag }}/bin" @@ -19,6 +21,7 @@ cinder_venv_tag: "testing" debug: true external_lb_vip_address: 10.100.100.3 galera_client_drop_config_file: false +galera_root_user: "root" galera_root_password: "secrete" internal_lb_vip_address: 10.100.100.3 keystone_admin_tenant_name: admin