Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple pv's in lvm::volume #349

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
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
Loading