Fix multiple backends with some drivers
Cinder generally supports defining multiple backends using the same driver. This means we have to expect the case cinder::backend::foo is used multiple times. However some of the defined types include the raw package resources which causes duplicate declarations. This fixes that and ensure we avoid duplication by ensure_packages. Change-Id: I6ceee41a4e3d26bfb1782b35d3f26821964e238f
This commit is contained in:
parent
cd7077a184
commit
047dc0f10e
|
@ -70,12 +70,10 @@ define cinder::backend::iscsi (
|
|||
# NOTE(mnaser): Cinder requires /usr/sbin/thin_check to create volumes which
|
||||
# does not get installed with Cinder (see LP#1615134).
|
||||
if $facts['os']['family'] == 'Debian' {
|
||||
if ! defined(Package['thin-provisioning-tools']) {
|
||||
package { 'thin-provisioning-tools':
|
||||
ensure => present,
|
||||
tag => 'cinder-support-package',
|
||||
}
|
||||
}
|
||||
ensure_packages( 'thin-provisioning-tools', {
|
||||
ensure => present,
|
||||
tag => 'cinder-support-package',
|
||||
})
|
||||
}
|
||||
|
||||
cinder_config {
|
||||
|
|
|
@ -76,16 +76,16 @@ define cinder::backend::nvmeof (
|
|||
"${name}/volume_group": value => $volume_group;
|
||||
}
|
||||
|
||||
package { 'nvmetcli':
|
||||
ensure_packages ( 'nvmetcli', {
|
||||
ensure => present,
|
||||
name => 'nvmetcli',
|
||||
tag => 'cinder-support-package',
|
||||
}
|
||||
})
|
||||
|
||||
package { 'nvme-cli':
|
||||
ensure_packages ( 'nvme-cli', {
|
||||
ensure => present,
|
||||
name => 'nvme-cli',
|
||||
tag => 'cinder-support-package',
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -109,10 +109,10 @@ define cinder::backend::vstorage (
|
|||
}
|
||||
|
||||
if $manage_package {
|
||||
package { 'vstorage-client':
|
||||
ensure_packages( 'vstorage-client', {
|
||||
ensure => present,
|
||||
tag => 'cinder-support-package',
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$mount_opts = ['-u', $mount_user_real, '-g', $mount_group, '-m', $mount_permissions]
|
||||
|
|
|
@ -32,13 +32,13 @@ describe 'cinder::backend::nvmeof' do
|
|||
|
||||
it { is_expected.to contain_package('nvmetcli').with(
|
||||
:name => 'nvmetcli',
|
||||
:ensure => 'present',
|
||||
:ensure => 'installed',
|
||||
:tag => 'cinder-support-package',
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_package('nvme-cli').with(
|
||||
:name => 'nvme-cli',
|
||||
:ensure => 'present',
|
||||
:ensure => 'installed',
|
||||
:tag => 'cinder-support-package',
|
||||
)}
|
||||
end
|
||||
|
|
|
@ -38,7 +38,10 @@ describe 'cinder::backend::vstorage' do
|
|||
:value => 'cinder.volume.drivers.vzstorage.VZStorageDriver'
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_package('vstorage-client').with_ensure('present') }
|
||||
it { is_expected.to contain_package('vstorage-client').with(
|
||||
:ensure => 'installed',
|
||||
:tag => 'cinder-support-package',
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_file('/etc/cinder/vstorage_shares.conf').with(
|
||||
:content => "stor1:passw0rd [\"-u\", \"cinder\", \"-g\", \"root\", \"-m\", \"0770\"]"
|
||||
|
|
Loading…
Reference in New Issue