Merge "Add region support for instance HA"

This commit is contained in:
Zuul 2019-06-15 05:21:32 +00:00 committed by Gerrit Code Review
commit d3796a69dd
2 changed files with 8 additions and 2 deletions

View File

@ -52,6 +52,10 @@
# The keystone project domain for nova
# Defaults to hiera('nova::keystone::authtoken::project_domain_name', 'Default')
#
# [*region_name*]
# (Optional) String. Region name for authenticating to Keystone.
# Defaults to hiera('nova::keystone::authtoken::region_name', 'regionOne')
#
# [*no_shared_storage*]
# Variable that defines the no_shared_storage for the nova evacuate resource
# Defaults to hiera('tripleo::instanceha::no_shared_storage', true)
@ -65,6 +69,7 @@ class tripleo::profile::base::pacemaker::instance_ha (
$keystone_domain = hiera('tripleo::clouddomain', 'localdomain'),
$user_domain = hiera('nova::keystone::authtoken::user_domain_name', 'Default'),
$project_domain = hiera('nova::keystone::authtoken::project_domain_name', 'Default'),
$region_name = hiera('nova::keystone::authtoken::region_name', 'regionOne'),
$no_shared_storage = hiera('tripleo::instanceha::no_shared_storage', true),
) {
if $step >= 2 {
@ -88,6 +93,7 @@ class tripleo::profile::base::pacemaker::instance_ha (
project_domain => $project_domain,
user_domain => $user_domain,
domain => $keystone_domain,
region_name => $region_name,
record_only => 1,
meta_attr => 'provides=unfencing',
pcmk_host_list => '',
@ -114,7 +120,7 @@ class tripleo::profile::base::pacemaker::instance_ha (
pacemaker::resource::ocf { 'nova-evacuate':
ocf_agent_name => 'openstack:NovaEvacuate',
# lint:ignore:140chars
resource_params => "auth_url=${keystone_endpoint_url} username=${keystone_admin} password=${keystone_password} user_domain=${user_domain} project_domain=${project_domain} tenant_name=${keystone_admin} ${iha_no_shared_storage}",
resource_params => "auth_url=${keystone_endpoint_url} username=${keystone_admin} password=${keystone_password} user_domain=${user_domain} project_domain=${project_domain} tenant_name=${keystone_admin} region_name=${region_name} ${iha_no_shared_storage}",
# lint:endignore
tries => $pcs_tries,
location_rule => {

View File

@ -53,7 +53,7 @@ describe 'tripleo::profile::base::pacemaker' do
})
is_expected.to contain_pcmk_resource('nova-evacuate').with({
:resource_type => "ocf:openstack:NovaEvacuate",
:resource_params => "auth_url=localhost:5000 username=admin password=password user_domain=Default project_domain=Default tenant_name=admin no_shared_storage=true",
:resource_params => "auth_url=localhost:5000 username=admin password=password user_domain=Default project_domain=Default tenant_name=admin region_name=regionOne no_shared_storage=true",
})
}
end