Merge "Force cinder properties to be set on ly on nodes with pcmk on it"
This commit is contained in:
commit
864f501b53
@ -62,7 +62,9 @@ class tripleo::profile::pacemaker::cinder::backup_bundle (
|
||||
|
||||
if $step >= 2 and $pacemaker_master {
|
||||
$cinder_backup_short_node_names = hiera('cinder_backup_short_node_names')
|
||||
$cinder_backup_short_node_names.each |String $node_name| {
|
||||
$pacemaker_short_node_names = hiera('pacemaker_short_node_names')
|
||||
$pcmk_cinder_backup_nodes = intersection($cinder_backup_short_node_names, $pacemaker_short_node_names)
|
||||
$pcmk_cinder_backup_nodes.each |String $node_name| {
|
||||
pacemaker::property { "cinder-backup-role-${node_name}":
|
||||
property => 'cinder-backup-role',
|
||||
value => true,
|
||||
@ -75,8 +77,6 @@ class tripleo::profile::pacemaker::cinder::backup_bundle (
|
||||
|
||||
if $step >= 5 {
|
||||
if $pacemaker_master {
|
||||
$cinder_backup_nodes_count = count(hiera('cinder_backup_short_node_names', []))
|
||||
|
||||
$docker_vol_arr = delete(any2array($docker_volumes), '').flatten()
|
||||
|
||||
unless empty($docker_vol_arr) {
|
||||
|
@ -62,7 +62,9 @@ class tripleo::profile::pacemaker::cinder::volume_bundle (
|
||||
|
||||
if $step >= 2 and $pacemaker_master {
|
||||
$cinder_volume_short_node_names = hiera('cinder_volume_short_node_names')
|
||||
$cinder_volume_short_node_names.each |String $node_name| {
|
||||
$pacemaker_short_node_names = hiera('pacemaker_short_node_names')
|
||||
$pcmk_cinder_volume_nodes = intersection($cinder_volume_short_node_names, $pacemaker_short_node_names)
|
||||
$pcmk_cinder_volume_nodes.each |String $node_name| {
|
||||
pacemaker::property { "cinder-volume-role-${node_name}":
|
||||
property => 'cinder-volume-role',
|
||||
value => true,
|
||||
@ -75,8 +77,6 @@ class tripleo::profile::pacemaker::cinder::volume_bundle (
|
||||
|
||||
if $step >= 5 {
|
||||
if $pacemaker_master {
|
||||
$cinder_volume_nodes_count = count(hiera('cinder_volume_short_node_names', []))
|
||||
|
||||
$docker_vol_arr = delete(any2array($docker_volumes), '').flatten()
|
||||
|
||||
unless empty($docker_vol_arr) {
|
||||
|
@ -36,8 +36,8 @@ describe 'tripleo::profile::pacemaker::cinder::backup_bundle' do
|
||||
} }
|
||||
|
||||
it 'should create pacemaker properties' do
|
||||
is_expected.to contain_pacemaker__property('cinder-backup-role-c-bak-1')
|
||||
is_expected.to contain_pacemaker__property('cinder-backup-role-c-bak-2')
|
||||
is_expected.to contain_pacemaker__property('cinder-backup-role-node.example.com')
|
||||
is_expected.to_not contain_pacemaker__property('cinder-backup-role-c-bak-2')
|
||||
end
|
||||
end
|
||||
|
||||
@ -48,7 +48,7 @@ describe 'tripleo::profile::pacemaker::cinder::backup_bundle' do
|
||||
} }
|
||||
|
||||
it 'should not create pacemaker properties' do
|
||||
is_expected.to_not contain_pacemaker__property('cinder-backup-role-c-bak-1')
|
||||
is_expected.to_not contain_pacemaker__property('cinder-backup-role-node.example.com')
|
||||
is_expected.to_not contain_pacemaker__property('cinder-backup-role-c-bak-2')
|
||||
end
|
||||
end
|
||||
|
@ -41,8 +41,8 @@ describe 'tripleo::profile::pacemaker::cinder::volume_bundle' do
|
||||
} }
|
||||
|
||||
it 'should create pacemaker properties' do
|
||||
is_expected.to contain_pacemaker__property('cinder-volume-role-c-vol-1')
|
||||
is_expected.to contain_pacemaker__property('cinder-volume-role-c-vol-2')
|
||||
is_expected.to contain_pacemaker__property('cinder-volume-role-node.example.com')
|
||||
is_expected.to_not contain_pacemaker__property('cinder-volume-role-c-vol-2')
|
||||
end
|
||||
end
|
||||
|
||||
@ -53,7 +53,7 @@ describe 'tripleo::profile::pacemaker::cinder::volume_bundle' do
|
||||
} }
|
||||
|
||||
it 'should not create pacemaker properties' do
|
||||
is_expected.to_not contain_pacemaker__property('cinder-volume-role-c-vol-1')
|
||||
is_expected.to_not contain_pacemaker__property('cinder-volume-role-node.example.com')
|
||||
is_expected.to_not contain_pacemaker__property('cinder-volume-role-c-vol-2')
|
||||
end
|
||||
end
|
||||
|
4
spec/fixtures/hieradata/default.yaml
vendored
4
spec/fixtures/hieradata/default.yaml
vendored
@ -28,11 +28,11 @@ ceph::profile::params::rgw_keystone_admin_password: 'keystone_admin_password'
|
||||
# cinder related items
|
||||
cinder_backup_short_bootstrap_node_name: 'node.example.com'
|
||||
cinder_backup_short_node_names:
|
||||
- 'c-bak-1'
|
||||
- 'node.example.com'
|
||||
- 'c-bak-2'
|
||||
cinder_volume_short_bootstrap_node_name: 'node.example.com'
|
||||
cinder_volume_short_node_names:
|
||||
- 'c-vol-1'
|
||||
- 'node.example.com'
|
||||
- 'c-vol-2'
|
||||
cinder::backup::nfs::backup_share: '/mnt/backup'
|
||||
cinder::rabbit_password: 'password'
|
||||
|
Loading…
Reference in New Issue
Block a user