Skip to main content
PyPI Package https://zuul-ci.org/gated.svg Python Black Code Style Ansible Code of Conduct Ansible mailing lists Repository License

Molecule libvirt is designed to allow use of libvirt for provisioning test resources.

Please note that this driver is currently in its early stage of development, do not even try to install or use it until this message is removed.

Quickstart

Installation

pip install molecule-libvirt

Create a scenario

With a new role

molecule init role -d libvirt my-role

This will create a new folder my-role containing a bare-bone generated role like you would do with ansible-galaxy init command.

It will also contain a molecule folder with a default scenario using the libvirt driver (using ansible community.libvirt collection).

Install the collection using:

ansible-galaxy install -r test_requirements.yml.

Example

This is a molecule.yml example file

dependency:
name: galaxy
driver:
  name: libvirt
platforms:
  - name: instance-1
    cpu: 1
    cpu_model: "qemu64"
    image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
    disk_size: "10G"
    ssh_port: 22
    memory_size: "1" # in GB
  - name: instance-2
    memory: "1"
    cpus: 1
    image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
    libvirt_host: "server.home.lan"
    libvirt_user: "james"
    bridge_name: "bridge0"
  - name: instance-3
    memory: "1"
    cpus: 1
    image_url: "https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
    libvirt_host: "server.home.lan"
    libvirt_user: "james"
    bridge_name: "bridge0"
provisioner:
  name: ansible
verifier:
  name: ansible

Optional parameters

molecule_bridge: existing bridge on local host. Can be useful if you want to set network interface name created for molecule. default value is: molecule-br0.

molecule_network_cidr: ip address range that should be bind to molecule virtual network. default value is: 10.10.10.0/24.

qemu_user: qemu process user. On RHEL like system qemu user is qemu. On Debian like, qemu user is libvirt-qemu. default value is: qemu.

cpu_model: specifies CPU model requested by the guest virtual machine. default is : qemu64.

arch: specifying the CPU architecture to virtualization. default is x86_64.

timezone: vm’s timezone. default is America/Toronto.

bridge_name: existing bridge on remote host. This bridge should allow VM being reachable with an ip address.

libvirt_host and libvirt_user: remote host parameters. libvirt_user should belongs to libvirt group.

Once set, you will have to run:

molecule test

Documentation

Read the documentation and more at https://molecule.readthedocs.io/.

Get Involved

Authors

  • James Regis

  • Gaëtan Trellu

  • Gariele Cerami

  • Sorin Sbarnea

License

The MIT License.

The logo is licensed under the Creative Commons NoDerivatives 4.0 License.

If you have some other use in mind, contact us.

Release files for molecule-libvirt 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for molecule-libvirt 0.0.6
File Size Uploaded
molecule-libvirt-0.0.6.tar.gz 24.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for molecule-libvirt 0.0.6
File Interpreter ABI Platform
molecule_libvirt-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 46.7 kB

Release files / molecule-libvirt-0.0.6.tar.gz

Download URL molecule-libvirt-0.0.6.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0a4847a758ebe511c51179d847c54e98b4bd2e66984368e404b0590d7e981141
BLAKE2b-256 checksum
How to use checksums
6c4b250a3157a71f64ab41aae61b136064a644541a6bdfcee8e4e7ead27e73dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / molecule_libvirt-0.0.6-py3-none-any.whl

Download URL molecule_libvirt-0.0.6-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa4713056d1b5ca68d59070ef24c04c8eff2599e3d155fd1f8bb46b48ffe3159
BLAKE2b-256 checksum
How to use checksums
aa3e0661b0fcb7b57d0ec52022eb574b92b93f33fffb36d196e89bf04f16ae3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page