Class: ForemanAP::Config

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

Overview

Parse the configuration file and provide configuration variables.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conffile = nil) ⇒ Config

Create an object

conffile

the path to the configuration file.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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

Instance Attribute Details

#foregroundObject (readonly)

DEPRECATED – do not use



19
20
21
# File 'lib/foreman_vm/config.rb', line 19

def foreground
  @foreground
end

#foreman_passwordObject (readonly)

The password to login to Foreman with.



11
12
13
# File 'lib/foreman_vm/config.rb', line 11

def foreman_password
  @foreman_password
end

#foreman_uriObject (readonly)

The URI of the Foreman server.



13
14
15
# File 'lib/foreman_vm/config.rb', line 13

def foreman_uri
  @foreman_uri
end

#foreman_userObject (readonly)

The user account to login to Foreman as.



9
10
11
# File 'lib/foreman_vm/config.rb', line 9

def foreman_user
  @foreman_user
end

#glusterfs_serverObject (readonly)

The FQDN of the GlusterFS server



27
28
29
# File 'lib/foreman_vm/config.rb', line 27

def glusterfs_server
  @glusterfs_server
end

#hypervisorsObject (readonly)

A list of all hypervisors in the cluster.



23
24
25
# File 'lib/foreman_vm/config.rb', line 23

def hypervisors
  @hypervisors
end

#libvirt_passwordObject (readonly)

The password to login to libvirtd with.



17
18
19
# File 'lib/foreman_vm/config.rb', line 17

def libvirt_password
  @libvirt_password
end

#libvirt_userObject (readonly)

The user account to login to libvirtd as.



15
16
17
# File 'lib/foreman_vm/config.rb', line 15

def libvirt_user
  @libvirt_user
end

#reap_buried_jobsObject (readonly)

DEPRECATED – do not use



21
22
23
# File 'lib/foreman_vm/config.rb', line 21

def reap_buried_jobs
  @reap_buried_jobs
end

#storage_poolObject (readonly)

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



25
26
27
# File 'lib/foreman_vm/config.rb', line 25

def storage_pool
  @storage_pool
end

#support_contact_emailObject (readonly)

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



29
30
31
# File 'lib/foreman_vm/config.rb', line 29

def support_contact_email
  @support_contact_email
end