configurable limits_conf path

Signed-off-by: Dominik Richter <dominik@vulcanosec.com>
This commit is contained in:
Dominik Richter 2015-08-01 09:52:55 +02:00
parent 70a6130335
commit 1344fba629
2 changed files with 10 additions and 6 deletions

View file

@ -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

View file

@ -62,10 +62,6 @@ module Serverspec
InetdConf.new()
end
def limits_conf()
LimitsConf.new()
end
def login_def()
LoginDef.new()
end