Skip to main content

virt-up Molecule Plugin :: run molecule tests using virt-up

Project description

Molecule VirtUp is designed to allow use of virt-up for provisioning of molecule test guests on a libvirt based hypervisor. The libvirt hypervisor may be local or remote.

See virt-up for installation instructions.

Requires

On the hypervisor (local or remote)

  • libvirt based hypervisor

  • ssh server and connection credentials if remote

  • python virt_up module and dependencies

Supported libvirt providers:

  • qemu/KVM

  • XEN

Example

To use this plugin, you’ll need to set the driver and platform variables in your molecule.yml. Here is a example using the generic/centos8 template:

driver:
  name: virtup
  options:
     connection: local
     host: localhost
     port: 22
     python_interpreter: "/usr/bin/python3"
     libvirt_default_uri: "qemu:///session"
     config_home: "~/.config/virt-up"
     data_home: "~/.local/share/virt-up"

platforms:
  - name: instance
    template: generic/centos8
    memory: 512
    cpus: 1

Environment variables

VIRTUP_OPTIONS_FILE

Specifies the path to the external yaml formatted options file. An external driver options yaml file is supported in order to promote driver independent molecule scenarios. Options specified in the molecule.yml take precedent.

Default: ~/.config/molecule-virtup.yml

Example:

---
connection: ssh
host: kvm.example.com
port: 22
libvirt_default_uri: "qemu:///session"

Options

connection

The ansible_connection type used when connecting to the hypervisor; local or ssh.

Default: local

host

The ansible_host used when connecting to the hypervisor.

Default: localhost

port

The ansible_port used when connecting to the hypervisor.

Default: 22

user

The ansible_user used when connecting to the hypervisor.

Default: None

loglevel

The logging level name. Log messages are written to the syslog on the hypervisor. Specify one of: critical, error, warning, warn, info, debug

Default: info

config_home

Specifies the virt_up configuration directory path.

data_home

Specifies the virt_up data directory path.

python_interpreter

Specifies the ansible_python_interpreter on the hypervisor.

Default: Detected by ansible

libvirt_default_uri

The libvirt local connection URI when the LIBVIRT_DEFAULT_URI environment variable is not present on the hypervisor for the ansible user. This URI should be a local connection URI, not ssh. The connection URI is used by the module running on the hypervisor to connect to the local libvirt daemon also running on the hypervisor.

virt_up defaults to qemu:///session when the LIBVIRT_DEFAULT_URI environment variable is not set on the hypervisor and the libvirt_default_uri option is not specified.

Default: None

password

The ansible_password used when connecting to the hypervisor.

Default: None

ssh_private_key_file

The ansible_private_key_file used when connecting to the hypervisor. Private key file used by ssh. Useful if using multiple keys and you don’t want to use SSH agent.

Default: None

ssh_common_args

The ansible_ssh_common_args used when connecting to the hypervisor. This setting is always appended to the default command line ssh..

Default: None

ssh_extra_args

The ansible_ssh_extra_args used when connecting to the hypervisor. This setting is always appended to the default ssh command line.

Default: None

ssh_pipelining

The ansible_ssh_pipelining used when connecting to the hypervisor. Determines whether or not to use SSH pipelining.

Default: None

ssh_executable

The ansible_ssh_executable used when connecting to the hypervisor. Overrides the ssh command to be used.

Default: None

Platform parameters

template

Name of the virt-up template definition on the hypervisor. See virt-up show templates.

Aliases: box

Default: default

size

Image size expressed as <number><units>, for example 10G.

Default: set by template definition

memory

Memory size of virtual machine in Mb. e.g. 2048

Default: set by template definition

cpus

Number of virtual cpus, e.g. 1

Default: set by template definition

Authors

Molecule Virt-Up Plugin was created by Michael Meffie based on code from Molecule.

License

The MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

molecule-virtup-1.5.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

molecule_virtup-1.5.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file molecule-virtup-1.5.0.tar.gz.

File metadata

  • Download URL: molecule-virtup-1.5.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for molecule-virtup-1.5.0.tar.gz
Algorithm Hash digest
SHA256 8c3c84d1cc12f63bff6e7148871d714a97725cf31b423ba337f1b6956270ffe5
MD5 282be974fb8515ab779cf3a01f607784
BLAKE2b-256 e507dcc77e2cfddb5ff75d9182043f77f1cb5181f4b16641be5708727fd92f88

See more details on using hashes here.

File details

Details for the file molecule_virtup-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: molecule_virtup-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for molecule_virtup-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91fac1d56239c2837fe40d03fd1b0a607e27dfe93b06a8cf0aa74a435f97eae6
MD5 1d87657c614cb369c78981970d53d593
BLAKE2b-256 b3ddd8f32ef2f95c65a6435fc05e7c635b6f552463ab64de22c36a0b510dbd52

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page