Class: ForemanMaintain::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/foreman_maintain/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Config

Returns a new instance of Config.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/foreman_maintain/config.rb', line 8

def initialize(options)
  @pre_setup_log_messages = []
  @config_file = options.fetch(:config_file, config_file_path)
  @options = load_config
  @definitions_dirs = @options.fetch(:definitions_dirs,
                                     [File.join(source_path, 'definitions')])
  load_log_configs
  @storage_file = @options.fetch(:storage_file, 'data.yml')
  @backup_dir = find_dir_path(
    @options.fetch(:backup_dir, '/var/lib/foreman-maintain')
  )
  @foreman_proxy_cert_path = @options.fetch(:foreman_proxy_cert_path, '/etc/foreman')
end

Instance Attribute Details

#backup_dirObject

Returns the value of attribute backup_dir.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def backup_dir
  @backup_dir
end

#config_fileObject

Returns the value of attribute config_file.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def config_file
  @config_file
end

#definitions_dirsObject

Returns the value of attribute definitions_dirs.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def definitions_dirs
  @definitions_dirs
end

#foreman_proxy_cert_pathObject

Returns the value of attribute foreman_proxy_cert_path.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def foreman_proxy_cert_path
  @foreman_proxy_cert_path
end

#log_dirObject

Returns the value of attribute log_dir.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def log_dir
  @log_dir
end

#log_file_sizeObject

Returns the value of attribute log_file_size.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def log_file_size
  @log_file_size
end

#log_levelObject

Returns the value of attribute log_level.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def log_level
  @log_level
end

#pre_setup_log_messagesObject

Returns the value of attribute pre_setup_log_messages.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def pre_setup_log_messages
  @pre_setup_log_messages
end

#storage_fileObject

Returns the value of attribute storage_file.



4
5
6
# File 'lib/foreman_maintain/config.rb', line 4

def storage_file
  @storage_file
end