Class: ForemanAP::Config
- Inherits:
-
Object
- Object
- ForemanAP::Config
- Defined in:
- lib/foreman_vm/config.rb
Overview
Parse the configuration file and provide configuration variables.
Instance Attribute Summary collapse
-
#foreground ⇒ Object
readonly
DEPRECATED – do not use.
-
#foreman_password ⇒ Object
readonly
The password to login to Foreman with.
-
#foreman_uri ⇒ Object
readonly
The URI of the Foreman server.
-
#foreman_user ⇒ Object
readonly
The user account to login to Foreman as.
-
#glusterfs_server ⇒ Object
readonly
The FQDN of the GlusterFS server.
-
#hypervisors ⇒ Object
readonly
A list of all hypervisors in the cluster.
-
#libvirt_password ⇒ Object
readonly
The password to login to libvirtd with.
-
#libvirt_user ⇒ Object
readonly
The user account to login to libvirtd as.
-
#reap_buried_jobs ⇒ Object
readonly
DEPRECATED – do not use.
-
#storage_pool ⇒ Object
readonly
The name of the shared storage pool to use on all hypervisors.
-
#support_contact_email ⇒ Object
readonly
The email address of the support team to contact if something goes wrong.
Instance Method Summary collapse
-
#initialize(conffile = nil) ⇒ Config
constructor
Create an object [
conffile
] the path to the configuration file.
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
#foreground ⇒ Object (readonly)
DEPRECATED – do not use
19 20 21 |
# File 'lib/foreman_vm/config.rb', line 19 def foreground @foreground end |
#foreman_password ⇒ Object (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_uri ⇒ Object (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_user ⇒ Object (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_server ⇒ Object (readonly)
The FQDN of the GlusterFS server
27 28 29 |
# File 'lib/foreman_vm/config.rb', line 27 def glusterfs_server @glusterfs_server end |
#hypervisors ⇒ Object (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_password ⇒ Object (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_user ⇒ Object (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_jobs ⇒ Object (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_pool ⇒ Object (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_email ⇒ Object (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 |