summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/provider/ini_setting/ruby.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/puppet/provider/ini_setting/ruby.rb b/lib/puppet/provider/ini_setting/ruby.rb
index ba8165c..aca8ba2 100644
--- a/lib/puppet/provider/ini_setting/ruby.rb
+++ b/lib/puppet/provider/ini_setting/ruby.rb
@@ -6,15 +6,30 @@ Puppet::Type.type(:ini_setting).provide(:ruby) do
end
def create
- ini_file.set_value(resource[:section], resource[:setting], resource[:value])
+ ini_file.set_value(section, setting, resource[:value])
ini_file.save
@ini_file = nil
end
+ def section
+ resource[:section]
+ end
+
+ def setting
+ resource[:setting]
+ end
+
+ def file_path
+ resource[:path]
+ end
+
+ def separator
+ resource[:key_val_separator] || '='
+ end
private
def ini_file
- @ini_file ||= Puppet::Util::IniFile.new(resource[:path],
- resource[:key_val_separator])
+ @ini_file ||= Puppet::Util::IniFile.new(file_path, separator)
end
+
end