mirror of
https://github.com/inspec/inspec
synced 2024-11-15 01:17:08 +00:00
Add automatic path resolution
Signed-off-by: David Gasper <dmgasper@osuosl.org>
This commit is contained in:
parent
098610f128
commit
6ba210d82d
1 changed files with 11 additions and 0 deletions
|
@ -8,6 +8,17 @@ module Inspec::Resources
|
|||
supports platform: "debian"
|
||||
desc "Use the postfix_conf Inspec audit resource to test the configuration of the Postfix Mail Transfer Agent"
|
||||
|
||||
# Allow user to specify a custom configuration path, use default Postfix configuration path if no custom path is provided
|
||||
def initialize(*opts)
|
||||
@params = {}
|
||||
if opts.length == 1
|
||||
@raw_content = load_raw_content(opts)
|
||||
else
|
||||
@raw_content = load_raw_content("/etc/postfix/main.cf")
|
||||
end
|
||||
@params = parse(@raw_content)
|
||||
end
|
||||
|
||||
def parse(content)
|
||||
SimpleConfig.new(content).params
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue