From 3db5bae6e1f677a692016ed904bcf534712b0b40 Mon Sep 17 00:00:00 2001 From: "Jesse Pretorius (odyssey4me)" Date: Mon, 13 Jan 2020 17:13:07 +0000 Subject: [PATCH] Add short node name override support to manila In line with the cinder & cinder-backup services, we add short node name override support to manila when implemented with pacemaker. This is required in order to complete the 'scale-up' upgrade steps for manila similar to the implementation in I3cfd4272449b207874723682903505d2bbdb435b Included is also an update to the tests and their fixtures to ensure that the unit tests for the manila data are consistent with the other similar services (cinder volume and cinder backup). Related-Bug: #1838971 Change-Id: I2c468e608a8f70d031b9ba08521bb75f7094c048 (cherry picked from commit e1348fecc80a5c746fd612d7c8a3cbbb58a974d4) --- manifests/profile/pacemaker/manila/share_bundle.pp | 10 +++++++++- ...ipleo_profile_pacemaker_manila_share_bundle_spec.rb | 6 +++--- spec/fixtures/hieradata/default.yaml | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/manifests/profile/pacemaker/manila/share_bundle.pp b/manifests/profile/pacemaker/manila/share_bundle.pp index 1295ecbef..71c52ddd0 100644 --- a/manifests/profile/pacemaker/manila/share_bundle.pp +++ b/manifests/profile/pacemaker/manila/share_bundle.pp @@ -91,7 +91,15 @@ class tripleo::profile::pacemaker::manila::share_bundle ( if $step >= 2 and $pacemaker_master { $manila_share_short_node_names = hiera('manila_share_short_node_names') - $manila_share_short_node_names.each |String $node_name| { + + if (hiera('pacemaker_short_node_names_override', undef)) { + $pacemaker_short_node_names = hiera('pacemaker_short_node_names_override') + } else { + $pacemaker_short_node_names = hiera('pacemaker_short_node_names') + } + + $pcmk_cinder_volume_nodes = intersection($manila_share_short_node_names, $pacemaker_short_node_names) + $pcmk_cinder_volume_nodes.each |String $node_name| { pacemaker::property { "manila-share-role-${node_name}": property => 'manila-share-role', value => true, diff --git a/spec/classes/tripleo_profile_pacemaker_manila_share_bundle_spec.rb b/spec/classes/tripleo_profile_pacemaker_manila_share_bundle_spec.rb index 1278856da..6f7681ca6 100644 --- a/spec/classes/tripleo_profile_pacemaker_manila_share_bundle_spec.rb +++ b/spec/classes/tripleo_profile_pacemaker_manila_share_bundle_spec.rb @@ -36,8 +36,8 @@ describe 'tripleo::profile::pacemaker::manila::share_bundle' do } } it 'should create pacemaker properties' do - is_expected.to contain_pacemaker__property('manila-share-role-manila-1') - is_expected.to contain_pacemaker__property('manila-share-role-manila-2') + is_expected.to contain_pacemaker__property('manila-share-role-node.example.com') + is_expected.to_not contain_pacemaker__property('manila-share-role-manila-2') end end @@ -48,7 +48,7 @@ describe 'tripleo::profile::pacemaker::manila::share_bundle' do } } it 'should not create pacemaker properties' do - is_expected.to_not contain_pacemaker__property('manila-share-role-manila-1') + is_expected.to_not contain_pacemaker__property('manila-share-role-node.example.com') is_expected.to_not contain_pacemaker__property('manila-share-role-manila-2') end end diff --git a/spec/fixtures/hieradata/default.yaml b/spec/fixtures/hieradata/default.yaml index 1c6182144..7ca4400da 100644 --- a/spec/fixtures/hieradata/default.yaml +++ b/spec/fixtures/hieradata/default.yaml @@ -66,7 +66,7 @@ manila::rabbit_password: 'password' manila::keystone::authtoken::password: 'password' manila_share_short_bootstrap_node_name: 'node.example.com' manila_share_short_node_names: - - 'manila-1' + - 'node.example.com' - 'manila-2' manila_api_short_bootstrap_node_name: node # nova related items