28 lines
486 B
Ruby
28 lines
486 B
Ruby
require 'serverspec'
|
|
|
|
set :backend, :exec
|
|
set :path, '/sbin:/usr/local/sbin:$PATH'
|
|
|
|
def get_family
|
|
fam = 'solaris2'
|
|
return fam unless File.exist? '/etc/release'
|
|
File.open("/etc/release") do |file|
|
|
while line = file.gets
|
|
case line
|
|
when /^\s*(OmniOS)/
|
|
fam = 'omnios'
|
|
end
|
|
end
|
|
end
|
|
fam
|
|
end
|
|
|
|
def postfix_conf_path
|
|
if os[:family] == 'solaris' && get_family == 'omnios'
|
|
'/opt/omni/etc/postfix/'
|
|
else
|
|
'/etc/postfix'
|
|
end
|
|
end
|
|
|