libvirt Molecule Plugin :: run molecule tests on libvirt
Project description
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
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: 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
Join us in the #ansible-molecule channel on Freenode.
Join the discussion in molecule-users Forum.
Join the community working group by checking the wiki.
Want to know about releases, subscribe to ansible-announce list.
For the full list of Ansible email Lists, IRC channels see the communication page.
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.
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
Built Distribution
File details
Details for the file molecule-libvirt-0.0.4.tar.gz
.
File metadata
- Download URL: molecule-libvirt-0.0.4.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f8b6749bc97ebcfbd6ab41a78b52a0761ceec674390889a4e02d6be7fdfd0ff |
|
MD5 | 898db1877362ff53f1d4abcf96647c57 |
|
BLAKE2b-256 | 811a849054738649e7d893cd47838b978628d3dd303f9f06879ab9dd8d59ef30 |
File details
Details for the file molecule_libvirt-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: molecule_libvirt-0.0.4-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdc49abcd93496c6036e793405dc60093880122542acd6fd84441fbb876180c7 |
|
MD5 | c237532fb12eccd035f1ef45ee2d6bbf |
|
BLAKE2b-256 | 8fb3f618cd7e41ec15c59dfb9083994e5fda58641759512e4898ed45cf6cb754 |