mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
577688a3a0
Many of the resources are named as a top-level class with a fairly generic class name, such as "OS". This causes an issue specifically with kitchen-google which depends on a gem which depends on the "os" gem which itself defines an OS class with a different superclass. This prevents users from using TK, Google Compute, and Inspec without this fix. Some mocked commands had their digest changed as well due to the new indentation, specifically in the User and RegistryKey classes. I strongly recommend viewing this diff with `git diff --ignore-space-change` to see the *real* changes. :)
31 lines
748 B
Ruby
31 lines
748 B
Ruby
# encoding: utf-8
|
|
# copyright: 2015, Vulcano Security GmbH
|
|
# author: Christoph Hartmann
|
|
# author: Dominik Richter
|
|
# license: All rights reserved
|
|
|
|
module Inspec::Resources
|
|
class Apache < Inspec.resource(1)
|
|
name 'apache'
|
|
|
|
attr_reader :service, :conf_dir, :conf_path, :user
|
|
def initialize
|
|
case inspec.os[:family]
|
|
when 'ubuntu', 'debian'
|
|
@service = 'apache2'
|
|
@conf_dir = '/etc/apache2/'
|
|
@conf_path = ::File.join @conf_dir, 'apache2.conf'
|
|
@user = 'www-data'
|
|
else
|
|
@service = 'httpd'
|
|
@conf_dir = '/etc/httpd/'
|
|
@conf_path = ::File.join @conf_dir, '/conf/httpd.conf'
|
|
@user = 'apache'
|
|
end
|
|
end
|
|
|
|
def to_s
|
|
'Apache Environment'
|
|
end
|
|
end
|
|
end
|