summaryrefslogtreecommitdiff
path: root/lib/puppet/type
diff options
context:
space:
mode:
authorChris Price <chris@puppetlabs.com>2012-07-28 21:59:54 -0700
committerChris Price <chris@puppetlabs.com>2012-07-28 21:59:54 -0700
commit9c76b6af1200c71e7ae72e0e2f349919a3081738 (patch)
treee3dc5ca1824f1fcf74c08e78d649eed394408a78 /lib/puppet/type
parent91273a5a2b0c88e7129908406fd0933a0d88ef11 (diff)
downloadpuppet-inifile-9c76b6af1200c71e7ae72e0e2f349919a3081738.tar.gz
puppet-inifile-9c76b6af1200c71e7ae72e0e2f349919a3081738.tar.bz2
First (basic) working version of ini_setting provider
Diffstat (limited to 'lib/puppet/type')
-rw-r--r--lib/puppet/type/ini_setting.rb26
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