Class: VagrantPlugins::ProviderLibvirt::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::ProviderLibvirt::Config
- Defined in:
- lib/vagrant-libvirt/config.rb
Instance Attribute Summary collapse
-
#connect_via_ssh ⇒ Object
If use ssh tunnel to connect to Libvirt.
-
#cpus ⇒ Object
Returns the value of attribute cpus.
-
#default_network ⇒ Object
Libvirt default network.
-
#driver ⇒ Object
A hypervisor name to access via Libvirt.
-
#host ⇒ Object
The name of the server, where libvirtd is running.
-
#id_ssh_key_file ⇒ Object
ID SSH key file.
-
#memory ⇒ Object
Domain specific settings used while creating new domain.
-
#nested ⇒ Object
Returns the value of attribute nested.
-
#password ⇒ Object
Password for Libvirt connection.
-
#storage_pool_name ⇒ Object
Libvirt storage pool name, where box image and instance snapshots will be stored.
-
#username ⇒ Object
The username to access Libvirt.
-
#volume_cache ⇒ Object
Returns the value of attribute volume_cache.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/vagrant-libvirt/config.rb', line 37 def initialize @driver = UNSET_VALUE @host = UNSET_VALUE @connect_via_ssh = UNSET_VALUE @username = UNSET_VALUE @password = UNSET_VALUE @id_ssh_key_file = UNSET_VALUE @storage_pool_name = UNSET_VALUE @default_network = UNSET_VALUE # Domain specific settings. @memory = UNSET_VALUE @cpus = UNSET_VALUE @nested = UNSET_VALUE @volume_cache = UNSET_VALUE end |
Instance Attribute Details
#connect_via_ssh ⇒ Object
If use ssh tunnel to connect to Libvirt.
13 14 15 |
# File 'lib/vagrant-libvirt/config.rb', line 13 def connect_via_ssh @connect_via_ssh end |
#cpus ⇒ Object
Returns the value of attribute cpus.
33 34 35 |
# File 'lib/vagrant-libvirt/config.rb', line 33 def cpus @cpus end |
#default_network ⇒ Object
Libvirt default network
29 30 31 |
# File 'lib/vagrant-libvirt/config.rb', line 29 def default_network @default_network end |
#driver ⇒ Object
A hypervisor name to access via Libvirt.
7 8 9 |
# File 'lib/vagrant-libvirt/config.rb', line 7 def driver @driver end |
#host ⇒ Object
The name of the server, where libvirtd is running.
10 11 12 |
# File 'lib/vagrant-libvirt/config.rb', line 10 def host @host end |
#id_ssh_key_file ⇒ Object
ID SSH key file
22 23 24 |
# File 'lib/vagrant-libvirt/config.rb', line 22 def id_ssh_key_file @id_ssh_key_file end |
#memory ⇒ Object
Domain specific settings used while creating new domain.
32 33 34 |
# File 'lib/vagrant-libvirt/config.rb', line 32 def memory @memory end |
#nested ⇒ Object
Returns the value of attribute nested.
34 35 36 |
# File 'lib/vagrant-libvirt/config.rb', line 34 def nested @nested end |
#password ⇒ Object
Password for Libvirt connection.
19 20 21 |
# File 'lib/vagrant-libvirt/config.rb', line 19 def password @password end |
#storage_pool_name ⇒ Object
Libvirt storage pool name, where box image and instance snapshots will be stored.
26 27 28 |
# File 'lib/vagrant-libvirt/config.rb', line 26 def storage_pool_name @storage_pool_name end |
#username ⇒ Object
The username to access Libvirt.
16 17 18 |
# File 'lib/vagrant-libvirt/config.rb', line 16 def username @username end |
#volume_cache ⇒ Object
Returns the value of attribute volume_cache.
35 36 37 |
# File 'lib/vagrant-libvirt/config.rb', line 35 def volume_cache @volume_cache end |
Instance Method Details
#finalize! ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/vagrant-libvirt/config.rb', line 54 def finalize! @driver = 'qemu' if @driver == UNSET_VALUE @host = nil if @host == UNSET_VALUE @connect_via_ssh = false if @connect_via_ssh == UNSET_VALUE @username = nil if @username == UNSET_VALUE @password = nil if @password == UNSET_VALUE @id_ssh_key_file = 'id_rsa' if @id_ssh_key_file == UNSET_VALUE @storage_pool_name = 'default' if @storage_pool_name == UNSET_VALUE @default_network = 'default' if @default_network == UNSET_VALUE # Domain specific settings. @memory = 512 if @memory == UNSET_VALUE @cpus = 1 if @cpus == UNSET_VALUE @nested = false if @nested == UNSET_VALUE @volume_cache = 'default' if @volume_cache == UNSET_VALUE end |
#validate(machine) ⇒ Object
71 72 |
# File 'lib/vagrant-libvirt/config.rb', line 71 def validate(machine) end |