Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
modify lvm::volume resouce to support multiple pv's
  • Loading branch information
imp- committed Sep 4, 2024
commit a2071e0817ae66a027ced50b921d6f13e8f89754
4 changes: 2 additions & 2 deletions manifests/volume.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# @param fstype The type of filesystem to create on the logical
# volume.
#
# @param pv path to physcial volume
# @param pv path(s) to physcial volume(s)
#
# @param vg value of volume group
#
Expand All @@ -36,7 +36,7 @@
#
define lvm::volume (
Enum['present', 'absent', 'cleaned'] $ensure,
Stdlib::Absolutepath $pv,
Variant[Stdlib::Absolutepath, Array[Stdlib::Absolutepath]] $pv,
String[1] $vg,
Optional[String[1]] $fstype = undef,
Optional[String[1]] $size = undef,
Expand Down
31 changes: 22 additions & 9 deletions spec/defines/volume_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@
describe 'lvm::volume' do
let(:title) { 'lv_example0' }

context 'when passed valid parameters, it will compile' do
let :params do
{
ensure: 'present',
vg: 'vg_example0',
pv: '/dev/sdd1',
fstype: 'ext4',
size: '100GB'
}
let :params do
{
ensure: 'present',
vg: 'vg_example0',
fstype: 'ext4',
size: '100GB'
}
end

context 'when passed with a single pv, it will compile' do
let(:params) do
super().merge({ 'pv' => '/dev/sdd1' })
end

it {
expect(subject).to compile
}
end

context 'when passed with multiple pvs, it will compile' do
let(:params) do
super().merge({ 'pv' => ['/dev/sdd1', '/dev/sde2'] })
end

it {
Expand Down