Class: ConfigBuilder::Model::Provider::Libvirt

Inherits:
Base
  • Object
show all
Defined in:
lib/config_builder/model/provider/libvirt.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attrs=, #call, def_model_attribute, model_attributes, new_from_hash

Constructor Details

#initializeLibvirt

Returns a new instance of Libvirt.



69
70
71
# File 'lib/config_builder/model/provider/libvirt.rb', line 69

def initialize
  @defaults = {}
end

Instance Attribute Details

#connect_via_sshString

Returns If use ssh tunnel to connect to Libvirt.

Returns:

  • (String)

    If use ssh tunnel to connect to Libvirt.



18
# File 'lib/config_builder/model/provider/libvirt.rb', line 18

def_model_attribute :connect_via_ssh

#default_prefixString

name)

Returns:

  • (String)

    Default host prefix (alternative to use project folder



56
# File 'lib/config_builder/model/provider/libvirt.rb', line 56

def_model_attribute :default_prefix

#driverString

Returns A hypervisor name to access via Libvirt.

Returns:

  • (String)

    A hypervisor name to access via Libvirt.



10
# File 'lib/config_builder/model/provider/libvirt.rb', line 10

def_model_attribute :driver

#hostString

Returns The name of the server, where libvirtd is running.

Returns:

  • (String)

    The name of the server, where libvirtd is running.



14
# File 'lib/config_builder/model/provider/libvirt.rb', line 14

def_model_attribute :host

#id_ssh_key_fileString

Returns ID SSH key file.

Returns:

  • (String)

    ID SSH key file



34
# File 'lib/config_builder/model/provider/libvirt.rb', line 34

def_model_attribute :id_ssh_key_file

#management_network_addressString

Returns Libvirt default network address.

Returns:

  • (String)

    Libvirt default network address



51
# File 'lib/config_builder/model/provider/libvirt.rb', line 51

def_model_attribute :management_network_address

#management_network_nameString

Returns Libvirt default network name.

Returns:

  • (String)

    Libvirt default network name



47
# File 'lib/config_builder/model/provider/libvirt.rb', line 47

def_model_attribute :management_network_name

#passwordString

Returns Password for Libvirt connection.

Returns:

  • (String)

    Password for Libvirt connection.



30
# File 'lib/config_builder/model/provider/libvirt.rb', line 30

def_model_attribute :password

#random_hostnameString

Returns Turn on to prevent hostname conflicts.

Returns:

  • (String)

    Turn on to prevent hostname conflicts



43
# File 'lib/config_builder/model/provider/libvirt.rb', line 43

def_model_attribute :random_hostname

#socketString

Returns Path towards the libvirt socket.

Returns:

  • (String)

    Path towards the libvirt socket



22
# File 'lib/config_builder/model/provider/libvirt.rb', line 22

def_model_attribute :socket

#storage_pool_nameString

snapshots will be stored.

Returns:

  • (String)

    Libvirt storage pool name, where box image and instance



39
# File 'lib/config_builder/model/provider/libvirt.rb', line 39

def_model_attribute :storage_pool_name

#uriString

Returns Manually specify URI.

Returns:

  • (String)

    Manually specify URI



6
# File 'lib/config_builder/model/provider/libvirt.rb', line 6

def_model_attribute :uri

#usernameString

Returns The username to access Libvirt.

Returns:

  • (String)

    The username to access Libvirt.



26
# File 'lib/config_builder/model/provider/libvirt.rb', line 26

def_model_attribute :username

Instance Method Details

#to_procObject



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/config_builder/model/provider/libvirt.rb', line 73

def to_proc
  Proc.new do |vm_config|
    vm_config.provider 'libvirt' do |vb_config|

      with_attr(:uri)               { |val| vb_config.host = val }
      with_attr(:driver)            { |val| vb_config.host = val }
      with_attr(:host)              { |val| vb_config.host = val }
      with_attr(:connect_via_ssh)   { |val| vb_config.connect_via_ssh = val }
      with_attr(:socket)            { |val| vb_config.socket = val }
      with_attr(:username)          { |val| vb_config.username = val }
      with_attr(:password)          { |val| vb_config.username = val }
      with_attr(:id_ssh_key_file)   { |val| vb_config.id_ssh_key_file = val }
      with_attr(:storage_pool_name) { |val| vb_config.storage_pool_name = val }
      with_attr(:random_hostname)   { |val| vb_config.random_hostname = val }
      with_attr(:management_network_name) { |val|
        vb_config.username = val
      }
      with_attr(:management_network_address) { |val|
        vb_config.username = val
      }
      with_attr(:default_prefix)    { |val| vb_config.username = val }
      with_attr(:memory)            { |val| vb_config.memory = val }
      with_attr(:cpus)              { |val| vb_config.cpus = val }
      with_attr(:cpu_mode)          { |val| vb_config.cpu_mode = val }
      with_attr(:disk_bus)          { |val| vb_config.disk_bus = val }
      with_attr(:nested)            { |val| vb_config.nested = val }
      with_attr(:volume_cache)      { |val| vb_config.volume_cache = val }
      with_attr(:kernel)            { |val| vb_config.kernel = val }
      with_attr(:cmd_line)          { |val| vb_config.cmd_line = val }
      with_attr(:initrd)            { |val| vb_config.initrd = val }
    end
  end
end