Skip to content

bkmeneguello/ansible-libvirt-inventory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Ansible Libvirt Inventory Plugin

About

Libvirt inventory plugin.

Requirements

Installed python-libvirt and, preferentially, qemu-guest-agent on each guest.

Features

Instructions

Clone this repository into "inventory_plugins" dir relative to your playbook:

git clone https://github.com/bkmeneguello/ansible-libvirt-inventory.git inventory_plugins/libvirt

Add some configurations to your "ansible.cfg":

[defaults]
inventory_plugins=./inventory_plugins

[inventory]
enable_plugins = libvirt

Create an inventory file with "libvirt.yml" suffix:

plugin: libvirt
# check the example inventory for more options

Let's test it:

ansible-inventory -i inventory.libvirt.yml --list

If you get a list with all the VM in your host, everything is ok.

You can include the dynamic inventory in your Ansible commands:

# Ping: connect to all VMs using root user
ansible -i inventory.libvirt.yml all -m ping -u root

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages