Class: Inspec::Resources::Apache

Inherits:
Object
  • Object
show all
Defined in:
lib/resources/apache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApache

Returns a new instance of Apache.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/resources/apache.rb', line 28

def initialize
  warn '[DEPRECATED] The `apache` resource is deprecated and will be removed in InSpec 4.0'

  if inspec.os.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

Instance Attribute Details

#conf_dirObject (readonly)

Returns the value of attribute conf_dir.



27
28
29
# File 'lib/resources/apache.rb', line 27

def conf_dir
  @conf_dir
end

#conf_pathObject (readonly)

Returns the value of attribute conf_path.



27
28
29
# File 'lib/resources/apache.rb', line 27

def conf_path
  @conf_path
end

#serviceObject (readonly)

Returns the value of attribute service.



27
28
29
# File 'lib/resources/apache.rb', line 27

def service
  @service
end

#userObject (readonly)

Returns the value of attribute user.



27
28
29
# File 'lib/resources/apache.rb', line 27

def user
  @user
end

Instance Method Details

#to_sObject



44
45
46
# File 'lib/resources/apache.rb', line 44

def to_s
  'Apache Environment'
end