Standardize tests inventory

The config for tests inventory is based on the keystone configuration.

Change-Id: I95d4ff54b36ee1b055d6ffc86975c277d906f6c7
This commit is contained in:
Marc Gariepy 2016-11-18 11:13:17 -05:00
parent 8bf2716a53
commit 596f76901b
3 changed files with 8 additions and 29 deletions

View File

@ -1,8 +1,8 @@
[all] [all]
localhost ansible_become=True localhost ansible_become=True
infra1 ansible_host=10.100.100.2 ansible_become=True ansible_user=root infra1 ansible_host=10.1.0.2 ansible_become=True ansible_user=root
keystone1 ansible_host=10.100.100.3 ansible_become=True ansible_user=root keystone1 ansible_host=10.1.0.3 ansible_become=True ansible_user=root
horizon1 ansible_host=10.100.100.4 ansible_become=True ansible_user=root horizon1 ansible_host=10.1.0.4 ansible_become=True ansible_user=root
[all_containers] [all_containers]
infra1 infra1

View File

@ -17,7 +17,7 @@ horizon_developer_mode: true
horizon_venv_tag: "testing" horizon_venv_tag: "testing"
horizon_git_install_branch: master horizon_git_install_branch: master
horizon_requirements_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_database: dash
horizon_galera_user: dash horizon_galera_user: dash
horizon_rabbitmq_password: "secrete" horizon_rabbitmq_password: "secrete"

View File

@ -18,31 +18,10 @@
user: root user: root
gather_facts: true gather_facts: true
pre_tasks: pre_tasks:
- name: Create DB for service - include: common/create-grant-db.yml
mysql_db: db_name: "{{ horizon_galera_database }}"
login_user: "{{ galera_root_user }}" db_password: "{{ horizon_container_mysql_password }}"
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'] }}"
roles: roles:
- role: "os_horizon" - role: "{{ horizon_rolename | default('os_horizon') }}"
vars_files: vars_files:
- common/test-vars.yml - common/test-vars.yml