Issue #8393 has been updated by James Turnbull. Status changed from Closed to Accepted
Matt - the ticket shouldn't be closed though. ---------------------------------------- Feature #8393: puppet-lvm filesystem provider need options parameter for mkfs create options https://projects.puppetlabs.com/issues/8393 Author: Mikael Fridh Status: Accepted Priority: Normal Assignee: Category: provider Target version: Affected Puppet version: Keywords: puppet-lvm lvm mkfs Branch: I needed to be able to specify filesystem create options to mkfs.xfs, so I made this simple patch: diff --git a/README.markdown b/README.markdown index 912576f..c3465ba 100644 --- a/README.markdown +++ b/README.markdown @@ -26,12 +26,13 @@ Here's a simple working example: } logical_volume { "mylv": ensure => present, - volume_group => "myvg" + volume_group => "myvg", size => "20G" } filesystem { "/dev/myvg/mylv": - ensure => present - fs_type => "ext3" + ensure => present, + fs_type => "ext3", + options => '-b 4096 -E stride=32,stripe-width=64' } This simple 1 physical volume, 1 volume group, 1 logical volume case @@ -40,6 +41,8 @@ be shortened to be: volume("myvg", "/dev/hdc", "mylv", "ext3", "20G") +Except that in the latter case you cannot specify create options. + If you need a more complex configuration, you'll need to build the resources out yourself. diff --git a/lib/puppet/provider/filesystem/lvm.rb b/lib/puppet/provider/filesystem/lvm.rb index c464d56..241ec0b 100644 --- a/lib/puppet/provider/filesystem/lvm.rb +++ b/lib/puppet/provider/filesystem/lvm.rb @@ -29,6 +29,11 @@ Puppet::Type.type(:filesystem).provide :lvm do command_array << mkfs_params[fs_type] end + if resource[:options] + mkfs_options = Array.new(resource[:options].split) + mkfs_cmd << mkfs_options + end + execute mkfs_cmd end diff --git a/lib/puppet/type/filesystem.rb b/lib/puppet/type/filesystem.rb index e945785..d456465 100644 --- a/lib/puppet/type/filesystem.rb +++ b/lib/puppet/type/filesystem.rb @@ -19,4 +19,8 @@ Puppet::Type.newtype(:filesystem) do end end + newparam(:options) do + desc "Params for the mkfs command. eg. -l internal,agcount=x" + end + end -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
