diff --git a/lib/resources/limits_conf.rb b/lib/resources/limits_conf.rb index 3dfc83c45..c87c61422 100644 --- a/lib/resources/limits_conf.rb +++ b/lib/resources/limits_conf.rb @@ -6,9 +6,9 @@ require 'utils/simpleconfig' class LimitsConf < Vulcano::Resource - def initialize + def initialize path @runner = Specinfra::Runner - @conf_path = '/etc/security/limits.conf' + @conf_path = path @files_contents = {} @content = nil @params = nil @@ -46,3 +46,11 @@ class LimitsConf < Vulcano::Resource @files_contents[path] ||= @runner.get_file_content(path).stdout end end + +module Serverspec::Type + def limits_conf(path = nil) + @limits_conf ||= {} + dpath = path || '/etc/security/limits.conf' + @limits_conf[dpath] ||= LimitsConf.new(dpath) + end +end \ No newline at end of file diff --git a/lib/resources/resources.rb b/lib/resources/resources.rb index 3bfe3b6c0..bdf722cb5 100644 --- a/lib/resources/resources.rb +++ b/lib/resources/resources.rb @@ -62,10 +62,6 @@ module Serverspec InetdConf.new() end - def limits_conf() - LimitsConf.new() - end - def login_def() LoginDef.new() end