Skip to content

Commit

Permalink
Support specifying an extent size when creating a volume group
Browse files Browse the repository at this point in the history
  • Loading branch information
glangloi committed Apr 8, 2024
1 parent 471a41b commit e1c93fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/puppet/provider/volume_group/lvm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ def self.get_logical_volume_properties(volume_groups_line)
end

def create
vgcreate(@resource[:name], *@resource.should(:physical_volumes))
vgcreate_args = [@resource[:name], *@resource.should(:physical_volumes)]
extent_args = @resource[:extent_size].nil? ? [] : ['-s', @resource[:extent_size]]

vgcreate_args.append(*extent_args)

vgcreate(*vgcreate_args)
end

def destroy
Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/type/volume_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
isnamevar
end

newparam(:extent_size) do
desc 'The physical extent size. Uses OS default if not provided. Only applicable on Linux.'
end

newproperty(:physical_volumes, array_matching: :all) do
desc "The list of physical volumes to be included in the volume group; this
will automatically set these as dependencies, but they must be defined elsewhere
Expand Down

0 comments on commit e1c93fd

Please sign in to comment.