summaryrefslogtreecommitdiff
path: root/lib/puppet/type
diff options
context:
space:
mode:
authorChris Price <chris@puppetlabs.com>2012-09-19 15:42:16 -0700
committerChris Price <chris@puppetlabs.com>2012-09-19 15:42:16 -0700
commit8d1fdc5c29d70027b0f1859145ced5ebb266cf9c (patch)
treef69e3c992d55096cdba3966713fd832b6e27a47d /lib/puppet/type
parent310a4b1575f7af903ac97108c6f1352d05f5f3fc (diff)
downloadpuppet-inifile-8d1fdc5c29d70027b0f1859145ced5ebb266cf9c.tar.gz
puppet-inifile-8d1fdc5c29d70027b0f1859145ced5ebb266cf9c.tar.bz2
Allow overriding separator string between key/val pairs
This introduces a new parameter, 'key_val_separator', which can be set in order to override the string that is used as a separator between the key/value pair of a setting line. The default is ' = ', but you could set the param to '=' if you don't want to include whitespace in your settings file.
Diffstat (limited to 'lib/puppet/type')
-rw-r--r--lib/puppet/type/ini_setting.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/puppet/type/ini_setting.rb b/lib/puppet/type/ini_setting.rb
index 9af47c1..f1ab490 100644
--- a/lib/puppet/type/ini_setting.rb
+++ b/lib/puppet/type/ini_setting.rb
@@ -30,4 +30,11 @@ 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(" = ")
+ end
+
+end