diff --git a/tests/inventory b/tests/inventory index eb11761f..38749898 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1,8 +1,8 @@ [all] localhost ansible_become=True -infra1 ansible_host=10.100.100.2 ansible_become=True ansible_user=root -keystone1 ansible_host=10.100.100.3 ansible_become=True ansible_user=root -horizon1 ansible_host=10.100.100.4 ansible_become=True ansible_user=root +infra1 ansible_host=10.1.0.2 ansible_become=True ansible_user=root +keystone1 ansible_host=10.1.0.3 ansible_become=True ansible_user=root +horizon1 ansible_host=10.1.0.4 ansible_become=True ansible_user=root [all_containers] infra1 diff --git a/tests/os_horizon-overrides.yml b/tests/os_horizon-overrides.yml index d6f7b4e7..ba939e9b 100644 --- a/tests/os_horizon-overrides.yml +++ b/tests/os_horizon-overrides.yml @@ -17,7 +17,7 @@ horizon_developer_mode: true horizon_venv_tag: "testing" horizon_git_install_branch: master horizon_requirements_git_install_branch: master -horizon_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}" +horizon_galera_address: "{{ test_galera_host }}" horizon_galera_database: dash horizon_galera_user: dash horizon_rabbitmq_password: "secrete" diff --git a/tests/test-install-horizon.yml b/tests/test-install-horizon.yml index eee58871..ba240b24 100644 --- a/tests/test-install-horizon.yml +++ b/tests/test-install-horizon.yml @@ -18,31 +18,10 @@ user: root gather_facts: true pre_tasks: - - name: Create DB for service - mysql_db: - login_user: "{{ galera_root_user }}" - login_password: "{{ galera_root_password }}" - login_host: "localhost" - name: "{{ horizon_galera_database }}" - state: "present" - when: inventory_hostname == groups['horizon_all'][0] - delegate_to: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}" - - name: Grant access to the DB for the service - mysql_user: - login_user: "{{ galera_root_user }}" - login_password: "{{ galera_root_password }}" - login_host: "localhost" - name: "{{ horizon_galera_database }}" - password: "{{ horizon_container_mysql_password }}" - host: "{{ item }}" - state: "present" - priv: "{{ horizon_galera_database }}.*:ALL" - with_items: - - "localhost" - - "%" - when: inventory_hostname == groups['horizon_all'][0] - delegate_to: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}" + - include: common/create-grant-db.yml + db_name: "{{ horizon_galera_database }}" + db_password: "{{ horizon_container_mysql_password }}" roles: - - role: "os_horizon" + - role: "{{ horizon_rolename | default('os_horizon') }}" vars_files: - common/test-vars.yml