diff options
Diffstat (limited to 'lib/puppet/type/ini_setting.rb')
-rw-r--r-- | lib/puppet/type/ini_setting.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/puppet/type/ini_setting.rb b/lib/puppet/type/ini_setting.rb index fb7f6e2..9af47c1 100644 --- a/lib/puppet/type/ini_setting.rb +++ b/lib/puppet/type/ini_setting.rb @@ -4,4 +4,30 @@ Puppet::Type.newtype(:ini_setting) do defaultvalues defaultto :present end + + newparam(:name, :namevar => true) do + desc 'An arbitrary name used as the identity of the resource.' + end + + newparam(:section) do + desc 'The name of the section in the ini file in which the setting should be defined.' + end + + newparam(:setting) do + desc 'The name of the setting to be defined.' + end + + newparam(:value) do + desc 'The value of the setting to be defined.' + end + + newparam(:path) do + desc 'The ini file Puppet will ensure contains the specified setting.' + validate do |value| + unless (Puppet.features.posix? and value =~ /^\//) or (Puppet.features.microsoft_windows? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/)) + raise(Puppet::Error, "File paths must be fully qualified, not '#{value}'") + end + end + end + end
\ No newline at end of file |