Class: VagrantPlugins::Libvirt::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Libvirt::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.
-
#driver ⇒ Object
A hypervisor name to access via Libvirt.
-
#host ⇒ Object
The name of the server, where libvirtd is running.
-
#memory ⇒ Object
Domain specific settings used while creating new domain.
-
#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.
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.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vagrant-libvirt/config.rb', line 29 def initialize @driver = UNSET_VALUE @host = UNSET_VALUE @connect_via_ssh = UNSET_VALUE @username = UNSET_VALUE @password = UNSET_VALUE @storage_pool_name = UNSET_VALUE # Domain specific settings. @memory = UNSET_VALUE @cpus = 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.
27 28 29 |
# File 'lib/vagrant-libvirt/config.rb', line 27 def cpus @cpus 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 |
#memory ⇒ Object
Domain specific settings used while creating new domain.
26 27 28 |
# File 'lib/vagrant-libvirt/config.rb', line 26 def memory @memory 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.
23 24 25 |
# File 'lib/vagrant-libvirt/config.rb', line 23 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 |
Instance Method Details
#finalize! ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vagrant-libvirt/config.rb', line 42 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 @storage_pool_name = 'default' if @storage_pool_name == UNSET_VALUE # Domain specific settings. @memory = 512 if @memory == UNSET_VALUE @cpus = 1 if @cpus == UNSET_VALUE end |
#validate(machine) ⇒ Object
55 56 |
# File 'lib/vagrant-libvirt/config.rb', line 55 def validate(machine) end |