Class: Packer::Builder::VirtualBoxISO

Inherits:
Packer::Builder show all
Defined in:
lib/packer/builders/virtualbox.rb

Constant Summary

Constants inherited from Packer::Builder

AMAZON_EBS, AMAZON_INSTANCE, DOCKER, NULL, VALID_BUILDER_TYPES, VIRTUALBOX_ISO, VMWARE_ISO, VMWARE_VMX

Instance Attribute Summary

Attributes inherited from Packer::Builder

#communicators

Attributes inherited from DataObject

#data, #key_dependencies, #required

Instance Method Summary collapse

Methods inherited from Packer::Builder

#communicator, get_builder, #name, #ssh_bastion_host, #ssh_bastion_password, #ssh_bastion_private_key_file, #ssh_bastion_username, #ssh_disable_agent, #ssh_handshake_attempts, #ssh_host, #ssh_password, #ssh_port, #ssh_private_key_file, #ssh_pty, #ssh_timeout, #ssh_username, types, #winrm_host, #winrm_password, #winrm_port, #winrm_timeout, #winrm_username

Methods inherited from DataObject

#__add_array_of_array_of_strings, #__add_array_of_hashes, #__add_array_of_ints, #__add_array_of_strings, #__add_boolean, #__add_hash, #__add_integer, #__add_json, #__add_string, #__exclusive_key_error, #add_key_dependencies, #add_required, #deep_copy, #validate, #validate_key_dependencies, #validate_required

Constructor Details

#initializeVirtualBoxISO

Returns a new instance of VirtualBoxISO.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/packer/builders/virtualbox.rb', line 8

def initialize
  super
  self.data['type'] = VIRTUALBOX_ISO
  self.add_required(
    'iso_checksum',
    'iso_checksum_type',
    'iso_url',
    'communicator'
  )
  self.communicators = %w(none ssh winrm)
end

Instance Method Details

#boot_command(commands) ⇒ Object



36
37
38
# File 'lib/packer/builders/virtualbox.rb', line 36

def boot_command(commands)
  self.__add_array_of_strings('boot_command', commands)
end

#boot_wait(time) ⇒ Object



40
41
42
# File 'lib/packer/builders/virtualbox.rb', line 40

def boot_wait(time)
  self.__add_string('boot_wait',time)
end

#disk_size(megabytes) ⇒ Object



44
45
46
# File 'lib/packer/builders/virtualbox.rb', line 44

def disk_size(megabytes)
  self.__add_integer('disk_size', megabytes)
end

#export_opts(vboxmanage_export_options) ⇒ Object



48
49
50
# File 'lib/packer/builders/virtualbox.rb', line 48

def export_opts(vboxmanage_export_options)
  self.__add_array_of_strings('export_opts', vboxmanage_export_options)
end

#floppy_files(files) ⇒ Object



52
53
54
# File 'lib/packer/builders/virtualbox.rb', line 52

def floppy_files(files)
  self.__add_array_of_strings('floppy_files', files)
end

#format(format) ⇒ Object



56
57
58
# File 'lib/packer/builders/virtualbox.rb', line 56

def format(format)
  self.__add_string('format', format)
end

#guest_additions_mode(mode) ⇒ Object



60
61
62
# File 'lib/packer/builders/virtualbox.rb', line 60

def guest_additions_mode(mode)
  self.__add_string('guest_additions_mode', mode)
end

#guest_additions_path(path) ⇒ Object



64
65
66
# File 'lib/packer/builders/virtualbox.rb', line 64

def guest_additions_path(path)
  self.__add_string('guest_additions_path', path)
end

#guest_additions_sha256(checksum) ⇒ Object



68
69
70
# File 'lib/packer/builders/virtualbox.rb', line 68

def guest_additions_sha256(checksum)
  self.__add_string('guest_additions_sha256', checksum)
end

#guest_additions_url(url) ⇒ Object



72
73
74
# File 'lib/packer/builders/virtualbox.rb', line 72

def guest_additions_url(url)
  self.__add_string('guest_additions_url', url)
end

#guest_os_type(ostype) ⇒ Object



76
77
78
# File 'lib/packer/builders/virtualbox.rb', line 76

def guest_os_type(ostype)
  self.__add_string('guest_os_type', ostype)
end

#hard_drive_interface(controllertype) ⇒ Object



80
81
82
# File 'lib/packer/builders/virtualbox.rb', line 80

def hard_drive_interface(controllertype)
  self.__add_string('hard_drive_interface', controllertype)
end

#headless(bool) ⇒ Object



84
85
86
# File 'lib/packer/builders/virtualbox.rb', line 84

def headless(bool)
  self.__add_boolean('headless', bool)
end

#http_directory(directory) ⇒ Object



88
89
90
# File 'lib/packer/builders/virtualbox.rb', line 88

def http_directory(directory)
  self.__add_string('http_directory', directory)
end

#http_port_max(port_number) ⇒ Object



96
97
98
# File 'lib/packer/builders/virtualbox.rb', line 96

def http_port_max(port_number)
  self.__add_integer('http_port_max', port_number)
end

#http_port_min(port_number) ⇒ Object



92
93
94
# File 'lib/packer/builders/virtualbox.rb', line 92

def http_port_min(port_number)
  self.__add_integer('http_port_min', port_number)
end

#iso_checksum(checksum) ⇒ Object



20
21
22
# File 'lib/packer/builders/virtualbox.rb', line 20

def iso_checksum(checksum)
  self.__add_string('iso_checksum', checksum)
end

#iso_checksum_type(type) ⇒ Object



24
25
26
# File 'lib/packer/builders/virtualbox.rb', line 24

def iso_checksum_type(type)
  self.__add_string('iso_checksum_type', type)
end

#iso_url(url) ⇒ Object



28
29
30
# File 'lib/packer/builders/virtualbox.rb', line 28

def iso_url(url)
  self.__add_string('iso_url', url, %w[iso_urls])
end

#iso_urls(urls) ⇒ Object



32
33
34
# File 'lib/packer/builders/virtualbox.rb', line 32

def iso_urls(urls)
  self.__add_array_of_strings('iso_urls', urls, %[iso_url])
end

#output_directory(directory) ⇒ Object



100
101
102
# File 'lib/packer/builders/virtualbox.rb', line 100

def output_directory(directory)
  self.__add_string('output_directory', directory)
end

#shutdown_command(command) ⇒ Object



104
105
106
# File 'lib/packer/builders/virtualbox.rb', line 104

def shutdown_command(command)
  self.__add_string('shutdown_command', command)
end

#shutdown_timeout(time) ⇒ Object



108
109
110
# File 'lib/packer/builders/virtualbox.rb', line 108

def shutdown_timeout(time)
  self.__add_string('shutdown_timeout', time)
end

#vboxmanage(array_of_commands) ⇒ Object



112
113
114
# File 'lib/packer/builders/virtualbox.rb', line 112

def vboxmanage(array_of_commands)
  self.__add_array_of_array_of_strings('vboxmanage', array_of_commands)
end

#vboxmanage_post(array_of_commands) ⇒ Object



116
117
118
# File 'lib/packer/builders/virtualbox.rb', line 116

def vboxmanage_post(array_of_commands)
  self.__add_array_of_array_of_strings('vboxmanage_post', array_of_commands)
end

#virtualbox_version_file(file) ⇒ Object



120
121
122
# File 'lib/packer/builders/virtualbox.rb', line 120

def virtualbox_version_file(file)
  self.__add_string('virtualbox_version_file', file)
end

#vm_name(name) ⇒ Object



124
125
126
# File 'lib/packer/builders/virtualbox.rb', line 124

def vm_name(name)
  self.__add_string('vm_name', name)
end