kiwi.storage.subformat.template Package

Submodules

kiwi.storage.subformat.template.vmware_settings Module

class kiwi.storage.subformat.template.vmware_settings.VmwareSettingsTemplate[source]

Bases: object

VMware machine settings template

get_template(memory_setup=False, cpu_setup=False, network_setup=False, iso_setup=False, disk_controller='ide', iso_controller='ide')[source]

VMware machine configuration template

Parameters:
  • memory_setup (bool) – with main memory setup true|false

  • cpu_setup (bool) – with number of CPU’s setup true|false

  • network_setup (bool) – with network emulation true|false

  • iso_setup (bool) – with CD/DVD drive emulation true|false

  • disk_controller (string) – add disk controller setup to template

  • iso_controller (string) – add CD/DVD controller setup to template

  • network_mac (string) – add static MAC address setup to template

  • network_driver (string) – add network driver setup to template

  • network_connection_type (string) – add connection type to template

Return type:

Template

kiwi.storage.subformat.template.vagrant_config Module

class kiwi.storage.subformat.template.vagrant_config.VagrantConfigTemplate[source]

Bases: object

Generate a Vagrantfile configuration template

This class creates a simple template for the Vagrantfile that is included inside a vagrant box.

The included Vagrantfile carries additional information for vagrant: by default that is nothing, but depending on the provider additional information need to be present. These can be passed via the parameter custom_settings to the method get_template().

Example usage:

The default without any additional settings will result in this Vagrantfile:

>>> vagrant_config = VagrantConfigTemplate()
>>> print(
...     vagrant_config.get_template()
... )
Vagrant.configure("2") do |config|
end

If your provider/box requires additional settings, provide them as follows:

>>> extra_settings = dedent('''
... config.vm.hostname = "no-dead-beef"
... config.vm.provider :special do |special|
...   special.secret_settings = "please_work"
... end
... ''').strip()
>>> print(
...     vagrant_config.get_template(extra_settings)
... )
Vagrant.configure("2") do |config|
  config.vm.hostname = "no-dead-beef"
  config.vm.provider :special do |special|
    special.secret_settings = "please_work"
  end
end
get_template(custom_settings=None)[source]

Return a new template with custom_settings included and indented appropriately.

Parameters:

custom_settings (str) – String of additional settings that get pasted into the Vagrantfile template. The string is put at the correct indentation level for you, but the internal indentation has to be provided by the caller.

Returns:

A string with custom_settings inserted at the appropriate position. The template has one the variable mac_address that must be substituted.

Return type:

str

kiwi.storage.subformat.template.virtualbox_ovf Module

class kiwi.storage.subformat.template.virtualbox_ovf.VirtualboxOvfTemplate[source]

Bases: object

Generate a OVF file template for a vagrant virtualbox box

This class provides a template for virtualbox’ ovf configuration file that is embedded inside the vagrant box. The template itself was extracted from a vagrant box that was build via packer and from a script provided by Neal Gompa.

get_template()[source]

Return the actual ovf template. The following values must be substituted: - vm_name: the name of this VM - disk_image_capacity: Size of the virtual disk image in GB - vm_description: a description of this VM

Module contents