summaryrefslogtreecommitdiff
path: root/lib/puppet/type/ini_setting.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/type/ini_setting.rb')
-rw-r--r--lib/puppet/type/ini_setting.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/puppet/type/ini_setting.rb b/lib/puppet/type/ini_setting.rb
index 9af47c1..50b6b38 100644
--- a/lib/puppet/type/ini_setting.rb
+++ b/lib/puppet/type/ini_setting.rb
@@ -30,4 +30,17 @@ Puppet::Type.newtype(:ini_setting) do
end
end
-end \ No newline at end of file
+ newparam(:key_val_separator) do
+ desc 'The separator string to use between each setting name and value. ' +
+ 'Defaults to " = ", but you could use this to override e.g. whether ' +
+ 'or not the separator should include whitespace.'
+ defaultto(" = ")
+
+ validate do |value|
+ unless value.scan('=').size == 1
+ raise Puppet::Error, ":key_val_separator must contain exactly one = character."
+ end
+ end
+ end
+
+end