Standardize the testing for Cinder
This PR standardizes the testing around the central tests repository: * Removes the install-cinder and prepare-vg playbooks * Moves the inventory settings into host_vars * Adjusts the "bridges" settings * Standardize IP addresses on the 10.1.1.0/24 range Change-Id: I91c8079b033bb83e0175a3ab4b1c020a8df4a0db Depends-On: Ibe2bcd91af9eac099e86e92f9294ed04fffe7b95
This commit is contained in:
parent
81e11817b2
commit
660c5b8bae
18
tests/cinder-overrides.yml
Normal file
18
tests/cinder-overrides.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
# Copyright 2016, Rackspace US, 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.
|
||||
|
||||
# There are currently no overrides required for the cinder role.
|
||||
# If you need cinder specific variable overries set them below and add
|
||||
# "-e @{toxinidir}/tests/cinder-overrides.yml \" to the ansible test run.
|
18
tests/host_vars/cinder.yml
Normal file
18
tests/host_vars/cinder.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
# Copyright 2016, Rackspace US, 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.
|
||||
|
||||
ansible_host: 10.1.1.103
|
||||
ansible_become: True
|
||||
ansible_user: root
|
18
tests/host_vars/infra1.yml
Normal file
18
tests/host_vars/infra1.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
# Copyright 2016, Rackspace US, 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.
|
||||
|
||||
ansible_host: 10.1.1.101
|
||||
ansible_become: True
|
||||
ansible_user: root
|
18
tests/host_vars/keystone.yml
Normal file
18
tests/host_vars/keystone.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
# Copyright 2016, Rackspace US, 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.
|
||||
|
||||
ansible_host: 10.1.1.102
|
||||
ansible_become: True
|
||||
ansible_user: root
|
@ -14,6 +14,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
bridges:
|
||||
- "br-mgmt"
|
||||
|
||||
- name: "br-mgmt"
|
||||
ip_addr: "10.1.1.1"
|
||||
ansible_become: True
|
||||
ansible_python_interpreter: "/usr/bin/python2"
|
||||
|
@ -1,8 +1,8 @@
|
||||
[all]
|
||||
localhost ansible_become=True
|
||||
infra1 ansible_host=10.100.100.2 ansible_become=True ansible_user=root
|
||||
keystone ansible_host=10.100.100.3 ansible_become=True ansible_user=root
|
||||
cinder ansible_host=10.100.100.4 ansible_become=True ansible_user=root
|
||||
localhost
|
||||
infra1
|
||||
keystone
|
||||
cinder
|
||||
|
||||
[all_containers]
|
||||
infra1
|
||||
|
@ -34,4 +34,3 @@
|
||||
{{ tempest_venv_bin | dirname }}/run_tempest.sh --no-virtual-env --serial tempest.api.volume.test_volumes_get
|
||||
vars_files:
|
||||
- common/test-vars.yml
|
||||
- test-vars.yml
|
||||
|
@ -1,70 +0,0 @@
|
||||
---
|
||||
# Copyright 2015, Rackspace US, 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.
|
||||
|
||||
- name: Deploy cinder
|
||||
hosts: cinder_all
|
||||
user: root
|
||||
gather_facts: true
|
||||
pre_tasks:
|
||||
- name: Ensure Rabbitmq vhost
|
||||
rabbitmq_vhost:
|
||||
name: "{{ cinder_rabbitmq_vhost }}"
|
||||
state: "present"
|
||||
delegate_to: "{{ hostvars[groups['rabbitmq_all'][0]]['ansible_host'] }}"
|
||||
when: inventory_hostname == groups['cinder_all'][0]
|
||||
- name: Ensure rabbitmq user
|
||||
rabbitmq_user:
|
||||
user: "{{ cinder_rabbitmq_userid }}"
|
||||
password: "{{ cinder_rabbitmq_password }}"
|
||||
vhost: "{{ cinder_rabbitmq_vhost }}"
|
||||
configure_priv: ".*"
|
||||
read_priv: ".*"
|
||||
write_priv: ".*"
|
||||
state: "present"
|
||||
delegate_to: "{{ hostvars[groups['rabbitmq_all'][0]]['ansible_host'] }}"
|
||||
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]
|
||||
delegate_to: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
|
||||
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]
|
||||
delegate_to: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
|
||||
with_items:
|
||||
- "localhost"
|
||||
- "%"
|
||||
tags:
|
||||
- mysql-db-setup
|
||||
roles:
|
||||
- role: "os_cinder"
|
||||
vars_files:
|
||||
- common/test-vars.yml
|
||||
- test-vars.yml
|
@ -1,52 +0,0 @@
|
||||
---
|
||||
# Copyright 2015, Rackspace US, 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.
|
||||
|
||||
- name: Prepare cinder-volumes volume group
|
||||
hosts: localhost
|
||||
tasks:
|
||||
- name: Install lvm2 apt package
|
||||
apt:
|
||||
name: lvm2
|
||||
when:
|
||||
- ansible_pkg_mgr == 'apt'
|
||||
- name: Install lvm2 yum package
|
||||
yum:
|
||||
name: lvm2
|
||||
when:
|
||||
- ansible_pkg_mgr == 'yum'
|
||||
- name: Create sparse Cinder file
|
||||
shell: "truncate -s 10G /openstack/cinder.img"
|
||||
args:
|
||||
creates: /openstack/cinder.img
|
||||
register: cinder_create
|
||||
- name: Get a loopback device for cinder file
|
||||
shell: losetup -f
|
||||
when: cinder_create | changed
|
||||
register: cinder_losetup
|
||||
- name: Create the loopback device
|
||||
shell: "losetup {{ cinder_losetup.stdout }} /openstack/cinder.img"
|
||||
when: cinder_create | changed
|
||||
- name: Make LVM physical volume on the cinder device
|
||||
shell: "{{ item }}"
|
||||
when: cinder_create | changed
|
||||
with_items:
|
||||
- "pvcreate {{ cinder_losetup.stdout }}"
|
||||
- "pvscan"
|
||||
- name: Add cinder-volumes volume group
|
||||
lvg:
|
||||
vg: cinder-volumes
|
||||
pvs: "{{ cinder_losetup.stdout }}"
|
||||
when: cinder_create | changed
|
||||
|
@ -1,42 +0,0 @@
|
||||
cinder_backends:
|
||||
lvm:
|
||||
volume_group: cinder-volumes
|
||||
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
|
||||
volume_backend_name: LVM_iSCSI
|
||||
cinder_default_volume_type: lvm
|
||||
|
||||
cinder_container_mysql_password: "SuperSecrete"
|
||||
cinder_developer_mode: true
|
||||
cinder_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}"
|
||||
cinder_git_install_branch: master
|
||||
cinder_glance_api_servers: "http://glance_server:9292"
|
||||
cinder_profiler_hmac_key: "secrete"
|
||||
cinder_rabbitmq_port: "{{ rabbitmq_port }}"
|
||||
cinder_rabbitmq_servers: "{{ hostvars[groups['rabbitmq_all'][0]]['ansible_host'] }}"
|
||||
cinder_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
|
||||
cinder_rabbitmq_password: "{{ rabbitmq_password }}"
|
||||
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_tag: "testing"
|
||||
|
||||
cinder_service_port: 8776
|
||||
cinder_service_proto: http
|
||||
cinder_service_publicuri: "{{ cinder_service_proto }}://{{ hostvars[groups['cinder_api'][0]]['ansible_host'] }}:{{ cinder_service_port }}"
|
||||
cinder_service_publicurl: "{{ cinder_service_publicuri }}/v1/%(tenant_id)s"
|
||||
cinder_service_adminuri: "{{ cinder_service_proto }}://{{ hostvars[groups['cinder_api'][0]]['ansible_host'] }}:{{ cinder_service_port }}"
|
||||
cinder_service_adminurl: "{{ cinder_service_adminuri }}/v1/%(tenant_id)s"
|
||||
cinder_service_internaluri: "{{ cinder_service_proto }}://{{ hostvars[groups['cinder_api'][0]]['ansible_host'] }}:{{ cinder_service_port }}"
|
||||
cinder_service_internalurl: "{{ cinder_service_internaluri }}/v1/%(tenant_id)s"
|
||||
|
||||
cinder_service_v2_port: 8776
|
||||
cinder_service_v2_proto: http
|
||||
cinder_service_v2_publicuri: "{{ cinder_service_v2_proto }}://{{ hostvars[groups['cinder_api'][0]]['ansible_host'] }}:{{ cinder_service_v2_port }}"
|
||||
cinder_service_v2_publicurl: "{{ cinder_service_publicuri }}/v2/%(tenant_id)s"
|
||||
cinder_service_v2_adminuri: "{{ cinder_service_v2_proto }}://{{ hostvars[groups['cinder_api'][0]]['ansible_host'] }}:{{ cinder_service_v2_port }}"
|
||||
cinder_service_v2_adminurl: "{{ cinder_service_adminuri }}/v2/%(tenant_id)s"
|
||||
cinder_service_v2_internaluri: "{{ cinder_service_v2_proto }}://{{ hostvars[groups['cinder_api'][0]]['ansible_host'] }}:{{ cinder_service_v2_port }}"
|
||||
cinder_service_v2_internalurl: "{{ cinder_service_internaluri }}/v2/%(tenant_id)s"
|
@ -17,7 +17,7 @@
|
||||
- include: common/test-setup-host.yml
|
||||
|
||||
# Prepare the cinder-volumes VG
|
||||
- include: test-prepare-vg.yml
|
||||
- include: common/test-setup-cinder-localhost.yml
|
||||
|
||||
# Install RabbitMQ/MariaDB
|
||||
- include: common/test-install-infra.yml
|
||||
@ -26,7 +26,7 @@
|
||||
- include: common/test-install-keystone.yml
|
||||
|
||||
# Install Cinder
|
||||
- include: test-install-cinder.yml
|
||||
- include: common/test-install-cinder.yml
|
||||
|
||||
# Install Tempest
|
||||
- include: common/test-install-tempest.yml
|
||||
|
Loading…
x
Reference in New Issue
Block a user