class ForemanAP::Config

Parse the configuration file and provide configuration variables.

Attributes

foreground[R]

DEPRECATED – do not use

foreman_password[R]

The password to login to Foreman with.

foreman_uri[R]

The URI of the Foreman server.

foreman_user[R]

The user account to login to Foreman as.

glusterfs_server[R]

The FQDN of the GlusterFS server

hypervisors[R]

A list of all hypervisors in the cluster.

libvirt_password[R]

The password to login to libvirtd with.

libvirt_user[R]

The user account to login to libvirtd as.

reap_buried_jobs[R]

DEPRECATED – do not use

storage_pool[R]

The name of the shared storage pool to use on all hypervisors.

support_contact_email[R]

The email address of the support team to contact if something goes wrong.

Public Class Methods

new(conffile = nil) click to toggle source

Create an object

conffile

the path to the configuration file.

# File lib/foreman_vm/config.rb, line 33
def initialize(conffile = nil)
  if conffile.nil?
    confdir = File.dirname(__FILE__) + '/../../conf'
    conffile = confdir + '/worker.yaml'
  end
  config = {
    :foreground => true,
    :reap_buried_jobs => true,
  }
  case conffile.kind_of?
  when String
    config.merge!(YAML.load_file(conffile))
  when Hash
    config.merge! conffile
  else
    raise ArgumentError
  end

  config.each { |k,v| instance_variable_set("@#{k}", v) }
  config
end