MCPcopy Index your code
hub / github.com/ansible-collections/community.libvirt

github.com/ansible-collections/community.libvirt @2.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.3.0 ↗ · + Follow
928 symbols 2,642 edges 43 files 509 documented · 55%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

community.libvirt Collection

Build Status Codecov

This repo hosts the community.libvirt Ansible Collection.

The collection includes the libvirt modules and plugins supported by Ansible libvirt community to help the management of virtual machines and/or containers via the libvirt API.

This collection is shipped with the ansible package.

Community standards

This project follows:

Communication

  • Join the Ansible forum:
  • Get Help: get help or help others. Please add appropriate tags if you start new discussions, for example the libvirt tag.
  • Posts tagged with 'libvirt': subscribe to participate in related conversations.
  • Social Spaces: gather and interact with fellow enthusiasts.
  • News & Announcements: track project-wide announcements including social events.

  • The Ansible Bullhorn newsletter: used to announce releases and important changes.

For more information about communication, see the Ansible communication guide.

Tested with Ansible

  • 2.17
  • 2.18
  • 2.19
  • 2.20
  • devel

External requirements

Some modules require additional system tools: - virt-install: required by the virt_install and virt_cloud_instance modules. - qemu-img: required by the virt_cloud_instance module.

Included content

Modules:

Inventory:

Connection:

Using this collection

Before using the libvirt collection, you need to install it with the Ansible Galaxy command-line tool:

ansible-galaxy collection install community.libvirt

You can include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: community.libvirt

You can also download the tarball from Ansible Galaxy and install the collection manually wherever you need.

Note that if you install the collection from Ansible Galaxy with the command-line tool or tarball, it will not be upgraded automatically when you upgrade the Ansible package. To upgrade the collection to the latest available version, run the following command:

ansible-galaxy collection install community.libvirt --upgrade

You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax:

ansible-galaxy collection install community.libvirt:==X.Y.Z

See Ansible Using collections for more details.

Contributing to this collection

The content of this collection is made by people just like you, a community of individuals collaborating on making the world better through developing automation software.

We are actively accepting new contributors.

All types of contributions are very welcome.

You don't know how to start? Refer to our contribution guide!

The aspiration is to follow the following general guidelines:

  • Changes should include tests and documentation where appropriate.
  • Changes will be lint tested using standard python lint tests.
  • No changes which do not pass CI testing will be approved/merged.
  • The collection plugins must provide the same coverage of python support as the versions of Ansible supported.
  • The versions of Ansible supported by the collection must be the same as those in developed, or those maintained, as shown in the Ansible Release and Maintenance documentation.

We use the following guidelines:

Local Testing

To learn how to test your pull request locally, refer to the Quick-start guide.

To learn how to test a pull request made by another person in your local environment, refer to the Test PR locally guide.

Collection maintenance

The current maintainers (contributors with write or higher access) are listed in the MAINTAINERS file. If you have questions or need help, feel free to mention them in the proposals.

To learn how to maintain / become a maintainer of this collection, refer to the Maintainer guidelines.

It is necessary for maintainers of this collection to be subscribed to:

  • The collection itself (the Watch button -> All Activity in the upper right corner of the repository's homepage).
  • The "Changes Impacting Collection Contributors and Maintainers" issue.

They also should be subscribed to Ansible's The Bullhorn newsletter.

Releases Support Timeline

We maintain each major release version (1.x.y, 2.x.y, ...) for one year after the next major version is released.

Here is the table for the support timeline: - 1.x.y: released 2020-08-18, maintained until 2026-07-21 (bugfixes only) - 2.x.y: released 2025-07-21, current

Publishing New Version

See the Releasing guidelines to learn more.

Reference

License

GNU General Public License v3.0 or later.

See LICENCE to see the full text.

Core symbols most depended-on inside this repo

_add_parameter
called by 73
plugins/module_utils/virt_install.py
_dict2options
called by 58
plugins/module_utils/virt_install.py
_build_command
called by 48
plugins/module_utils/virt_install.py
find_entry
called by 35
plugins/modules/virt_pool.py
_get_param_combined_items
called by 28
plugins/module_utils/virt_install.py
find_entry
called by 25
plugins/modules/virt_net.py
core
called by 22
plugins/modules/virt_install.py
execute
called by 22
plugins/module_utils/virt_install.py

Shape

Method 639
Route 111
Function 110
Class 68

Languages

Python100%

Modules by API surface

tests/unit/module_utils/test_virt_install.py153 symbols
tests/unit/modules/test_virt_cloud_instance.py150 symbols
tests/unit/module_utils/test_libvirt.py98 symbols
plugins/module_utils/virt_install.py98 symbols
tests/unit/module_utils/test_qemu.py62 symbols
plugins/modules/virt_pool.py51 symbols
tests/unit/modules/test_virt_install.py44 symbols
plugins/modules/virt_net.py43 symbols
plugins/modules/virt.py32 symbols
plugins/module_utils/libvirt.py28 symbols
plugins/modules/virt_secret.py25 symbols
plugins/modules/virt_cloud_instance.py17 symbols

For agents

$ claude mcp add community.libvirt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact