
Create a new variable called galera_cluster_members which is a list of the hosts that make up the galera cluster. Set the default value to groups['galera_all'] which is the group used by openstack-ansible to refer to the members of the cluster. Replace all other references to groups['galera_all'] with the new variable. This allows other consumers of this role to use their own group naming scheme. Add a new task to verify that current host is a member of galera_cluster_members. Add the var galera_client_drop_config_file=true to the role dependency galera_client, this is required because the default value for that var in the galera_client role is based on membership of the galera_all group. Modify the functional testing to override galera_cluster_members, this aims to prevent the return of any hard-coded role references. Change-Id: I59af07217114a001cbebaa95a651919d53c9ec21
105 lines
3.4 KiB
YAML
105 lines
3.4 KiB
YAML
---
|
|
# 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.
|
|
|
|
# Run basic prep
|
|
- include: test-prep.yml
|
|
|
|
# Run container clean up and build
|
|
- include: test-container-create.yml
|
|
|
|
# Deploy the environment
|
|
- name: Playbook for role testing
|
|
hosts: galera_test_hosts
|
|
serial: 1
|
|
user: root
|
|
gather_facts: true
|
|
vars:
|
|
galera_cluster_members: "{{ groups['galera_test_hosts'] }}"
|
|
galera_root_password: secrete
|
|
galera_root_user: root
|
|
galera_innodb_buffer_pool_size: 512M
|
|
galera_innodb_log_buffer_size: 32M
|
|
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
|
galera_wsrep_node_name: "{{ inventory_hostname }}"
|
|
galera_wsrep_provider_options:
|
|
- { option: "gcache.size", value: "32M" }
|
|
roles:
|
|
- role: "{{ rolename | basename }}"
|
|
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
|
|
|
# Run playbook test
|
|
- include: test-functional.yml
|
|
|
|
############################# UPGRADE TESTING #############################
|
|
|
|
# Run container clean up and build
|
|
- include: test-container-create.yml
|
|
|
|
# Deploy the environment running a 5.5 to 10.0 upgrade
|
|
- name: Playbook for role upgrade testing
|
|
hosts: galera_test_hosts
|
|
serial: 1
|
|
user: root
|
|
gather_facts: true
|
|
vars:
|
|
galera_cluster_members: "{{ groups['galera_test_hosts'] }}"
|
|
galera_root_password: secrete
|
|
galera_root_user: root
|
|
galera_innodb_buffer_pool_size: 512M
|
|
galera_innodb_log_buffer_size: 32M
|
|
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
|
galera_wsrep_node_name: "{{ inventory_hostname }}"
|
|
galera_wsrep_provider_options:
|
|
- { option: "gcache.size", value: "32M" }
|
|
pre_tasks:
|
|
- debug:
|
|
msg: "===== Running MariaDB 5.5 Deployment for Upgrade ====="
|
|
roles:
|
|
- role: "{{ rolename | basename }}"
|
|
galera_mariadb_server_package: "mariadb-galera-server-5.5"
|
|
galera_apt_repo_url: "https://mirror.rackspace.com/mariadb/repo/5.5/ubuntu"
|
|
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
|
|
|
# Run initial playbook test
|
|
- include: test-functional.yml
|
|
|
|
# Deploy the environment running a 5.5 to 10.0 upgrade
|
|
- name: Playbook for role upgrade testing
|
|
hosts: galera_test_hosts
|
|
serial: 1
|
|
user: root
|
|
gather_facts: true
|
|
vars:
|
|
galera_cluster_members: "{{ groups['galera_test_hosts'] }}"
|
|
galera_root_password: secrete
|
|
galera_root_user: root
|
|
galera_innodb_buffer_pool_size: 512M
|
|
galera_innodb_log_buffer_size: 32M
|
|
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
|
galera_wsrep_node_name: "{{ inventory_hostname }}"
|
|
galera_wsrep_provider_options:
|
|
- { option: "gcache.size", value: "32M" }
|
|
pre_tasks:
|
|
- debug:
|
|
msg: "===== Running MariaDB 5.5 to current Upgrade ====="
|
|
roles:
|
|
- role: "{{ rolename | basename }}"
|
|
galera_server_id: "{{ inventory_hostname | string_2_int }}"
|
|
galera_ignore_cluster_state: true
|
|
galera_upgrade: true
|
|
|
|
# Run final playbook test
|
|
- include: test-functional.yml
|