Cinder test cleanup

This commit does the following:

- fully defines the inventory rather than having test-prepare-host.yml
  add containers to it
- updates test-prepare-keys.yml to use localhost instead of 127.0.0.1,
  uses become_user=jenkins instead of become=false, and removes
  redundant connection
- updates test-prepare-host.yml by changing 127.0.0.1 to localhost, and
  removes mocking ansible_env
- groups vars in defined in each individual file into a single
  test-vars.yml file

Change-Id: I198aab420f5d4c0aa17ef64a05ce300e18d0b108
This commit is contained in:
Matt Thompson 2016-03-31 14:30:18 +01:00 committed by Jesse Pretorius (odyssey4me)
parent e4f53b2852
commit 321cedd504
8 changed files with 129 additions and 102 deletions

View File

@ -0,0 +1,27 @@
---
# 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_ssh_host: "{{ ansible_host }}"
container_name: "{{ inventory_hostname }}"
container_networks:
management_address:
address: "{{ ansible_host }}"
bridge: "lxcbr0"
interface: "eth1"
netmask: "255.255.252.0"
type: "veth"
physical_host: localhost
properties:
service_name: "{{ inventory_hostname }}"

View File

@ -1,8 +1,39 @@
[all]
localhost ansible_connection=local ansible_become=True
infra1 ansible_host=10.100.100.2 ansible_become=True ansible_user=root
openstack1 ansible_host=10.100.100.3 ansible_become=True ansible_user=root
[all_containers]
infra1
openstack1
[rabbitmq_all]
infra1
[galera_all]
infra1
[service_all:children]
rabbitmq_all
galera_all
[keystone_all]
openstack1
[cinder_api]
openstack1
[cinder_scheduler]
openstack1
[cinder_backup]
openstack1
[cinder_volume]
localhost ansible_connection=local ansible_become=True
localhost
[cinder_all]
localhost ansible_connection=local ansible_become=True
[cinder_all:children]
cinder_api
cinder_scheduler
cinder_backup
cinder_volume

View File

@ -37,6 +37,5 @@
until: volume_status|success
retries: 5
delay: 5
vars:
cinder_venv_tag: testing
cinder_venv_bin: "/openstack/venvs/cinder-{{ cinder_venv_tag }}/bin"
vars_files:
- test-vars.yml

View File

@ -37,44 +37,5 @@
when: inventory_hostname == groups['cinder_all'][0]
roles:
- role: "{{ rolename | basename }}"
vars:
external_lb_vip_address: 10.100.100.3
internal_lb_vip_address: 10.100.100.3
cinder_galera_address: 10.100.100.2
cinder_venv_tag: "testing"
cinder_developer_mode: true
cinder_git_install_branch: stable/mitaka
cinder_requirements_git_install_branch: f8cf7eba898a1424549c730d6692ec4e9573c0ed # HEAD of "master" as of 23.03.2016
cinder_service_password: "secrete"
cinder_container_mysql_password: "SuperSecrete"
cinder_profiler_hmac_key: "secrete"
cinder_backends:
lvm:
volume_group: cinder-volumes
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name: LVM_iSCSI
cinder_rabbitmq_password: "secrete"
cinder_rabbitmq_userid: cinder
cinder_rabbitmq_vhost: /cinder
cinder_glance_api_servers: "http://glance_server:9292"
galera_root_password: "secrete"
galera_client_drop_config_file: false
rabbitmq_servers: 10.100.100.2
rabbitmq_use_ssl: true
rabbitmq_port: 5671
keystone_admin_user_name: admin
keystone_admin_tenant_name: admin
keystone_auth_admin_password: "SuperSecretePassword"
keystone_service_adminuri_insecure: false
keystone_service_internaluri_insecure: false
keystone_service_internaluri: "http://{{ internal_lb_vip_address }}:5000"
keystone_service_internalurl: "{{ keystone_service_internaluri }}/v3"
keystone_service_adminuri: "http://{{ internal_lb_vip_address }}:35357"
keystone_service_adminurl: "{{ keystone_service_adminuri }}/v3"
openrc_os_auth_url: "{{ keystone_service_internalurl }}"
openrc_os_password: "{{ keystone_auth_admin_password }}"
openrc_os_domain_name: "Default"
memcached_servers: 127.0.0.1
memcached_encryption_key: "secrete"
debug: true
verbose: true
vars_files:
- test-vars.yml

View File

@ -61,23 +61,5 @@
when: inventory_hostname == groups['keystone_all'][0]
roles:
- role: os_keystone
vars:
external_lb_vip_address: 10.100.100.3
internal_lb_vip_address: 10.100.100.3
keystone_galera_address: 10.100.100.2
keystone_galera_database: keystone
keystone_venv_tag: "testing"
keystone_developer_mode: true
keystone_git_install_branch: stable/mitaka
keystone_requirements_git_install_branch: f8cf7eba898a1424549c730d6692ec4e9573c0ed # HEAD of "master" as of 23.03.2016
keystone_auth_admin_token: "SuperSecreteTestToken"
keystone_auth_admin_password: "SuperSecretePassword"
keystone_service_password: "secrete"
keystone_rabbitmq_password: "secrete"
keystone_container_mysql_password: "SuperSecrete"
keystone_rabbitmq_port: 5671
keystone_rabbitmq_userid: keystone
keystone_rabbitmq_vhost: /keystone
keystone_rabbitmq_servers: 10.100.100.2
keystone_rabbitmq_use_ssl: false
galera_client_drop_config_file: false
vars_files:
- test-vars.yml

View File

@ -24,10 +24,10 @@
- name: Ensure root's new public ssh key is in authorized_keys
authorized_key:
user: root
key: "{{ hostvars['127.0.0.1']['lxc_container_ssh_key'] }}"
key: "{{ hostvars['localhost']['lxc_container_ssh_key'] }}"
manage_dir: no
- set_fact:
lxc_container_ssh_key: "{{ hostvars['127.0.0.1']['lxc_container_ssh_key'] }}"
lxc_container_ssh_key: "{{ hostvars['localhost']['lxc_container_ssh_key'] }}"
- name: Check if this is an OpenStack-CI nodepool instance
stat:
path: /etc/nodepool/provider
@ -58,33 +58,3 @@
name: "trusty.tgz"
sha256sum: "56c6a6e132ea7d10be2f3e8104f47136ccf408b30e362133f0dc4a0a9adb4d0c"
chroot_path: trusty/rootfs-amd64
# The $HOME directory is mocked to work with tox
# by defining the 'ansible_env' hash. This should
# NEVER be done outside of testing.
ansible_env: ## NEVER DO THIS OUTSIDE OF TESTING
HOME: "/tmp"
post_tasks:
# Inventory is being pre-loaded using a post tasks instead of through a dynamic
# inventory system. While this is not a usual method for deployment it's being
# done for functional testing.
- name: Create container hosts
add_host:
groups: "{{ item.groups }}"
hostname: "{{ item.name }}"
inventory_hostname: "{{ item.name }}"
ansible_ssh_host: "{{ item.address }}"
ansible_become: true
properties:
service_name: "{{ item.service }}"
container_networks:
management_address:
address: "{{ item.address }}"
bridge: "lxcbr0"
interface: "eth1"
netmask: "255.255.252.0"
type: "veth"
physical_host: localhost
container_name: "{{ item.name }}"
with_items:
- { name: "infra1", service: "infra1", address: "10.100.100.2", groups: "all,all_containers,rabbitmq_all,galera_all,service_all" }
- { name: "openstack1", service: "openstack1", address: "10.100.100.3", groups: "all,all_containers,keystone_all,cinder_api,cinder_scheduler,cinder_backup,cinder_all" }

View File

@ -13,10 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: we use become_user because setting become: no or become: false
# doesn't seem to override the ansible_become=true in the
# inventory
- name: Create ssh key pairs for use with containers
hosts: 127.0.0.1
connection: local
become: false
hosts: localhost
become_user: "{{ ansible_ssh_user }}"
pre_tasks:
- name: Create ssh key pair for root
user:

55
tests/test-vars.yml Normal file
View File

@ -0,0 +1,55 @@
cinder_backends:
lvm:
volume_group: cinder-volumes
volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver
volume_backend_name: LVM_iSCSI
cinder_container_mysql_password: "SuperSecrete"
cinder_developer_mode: true
cinder_galera_address: 10.100.100.2
cinder_git_install_branch: stable/mitaka
cinder_glance_api_servers: "http://glance_server:9292"
cinder_profiler_hmac_key: "secrete"
cinder_rabbitmq_password: "secrete"
cinder_rabbitmq_userid: cinder
cinder_rabbitmq_vhost: /cinder
cinder_requirements_git_install_branch: stable/mitaka
cinder_service_password: "secrete"
cinder_venv_bin: "/openstack/venvs/cinder-{{ cinder_venv_tag }}/bin"
cinder_venv_tag: "testing"
debug: true
external_lb_vip_address: 10.100.100.3
galera_client_drop_config_file: false
galera_root_password: "secrete"
internal_lb_vip_address: 10.100.100.3
keystone_admin_tenant_name: admin
keystone_admin_user_name: admin
keystone_auth_admin_password: "SuperSecretePassword"
keystone_container_mysql_password: "SuperSecrete"
keystone_developer_mode: true
keystone_galera_address: 10.100.100.2
keystone_galera_database: keystone
keystone_git_install_branch: stable/mitaka
keystone_rabbitmq_password: "secrete"
keystone_rabbitmq_port: 5671
keystone_rabbitmq_servers: 10.100.100.2
keystone_rabbitmq_use_ssl: false
keystone_rabbitmq_userid: keystone
keystone_rabbitmq_vhost: /keystone
keystone_requirements_git_install_branch: stable/mitaka
keystone_service_adminuri: "http://{{ internal_lb_vip_address }}:35357"
keystone_service_adminuri_insecure: false
keystone_service_adminurl: "{{ keystone_service_adminuri }}/v3"
keystone_service_internaluri: "http://{{ internal_lb_vip_address }}:5000"
keystone_service_internaluri_insecure: false
keystone_service_internalurl: "{{ keystone_service_internaluri }}/v3"
keystone_service_password: "secrete"
keystone_venv_tag: "testing"
memcached_encryption_key: "secrete"
memcached_servers: 127.0.0.1
openrc_os_auth_url: "{{ keystone_service_internalurl }}"
openrc_os_domain_name: "Default"
openrc_os_password: "{{ keystone_auth_admin_password }}"
rabbitmq_port: 5671
rabbitmq_servers: 10.100.100.2
rabbitmq_use_ssl: true
verbose: true