Skip to content

Commit a63b8bf

Browse files
committed
Support specifying an extent size when creating a volume group
1 parent 8e3a586 commit a63b8bf

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/puppet/provider/volume_group/lvm.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ def self.get_logical_volume_properties(volume_groups_line)
4444
end
4545

4646
def create
47-
vgcreate(@resource[:name], *@resource.should(:physical_volumes))
47+
vgcreate_args = [@resource[:name], *@resource.should(:physical_volumes)]
48+
extent_args = @resource[:extent_size].nil? ? [] : ['-s', @resource[:extent_size]]
49+
50+
vgcreate_args.append(*extent_args)
51+
52+
vgcreate(*vgcreate_args)
4853
end
4954

5055
def destroy

lib/puppet/type/volume_group.rb

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
isnamevar
1111
end
1212

13+
newparam(:extent_size) do
14+
desc 'The physical extent size. Uses OS default if not provided. Only applicable on Linux.'
15+
end
16+
1317
newproperty(:physical_volumes, array_matching: :all) do
1418
desc "The list of physical volumes to be included in the volume group; this
1519
will automatically set these as dependencies, but they must be defined elsewhere

0 commit comments

Comments
 (0)