Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ init system when libvirtd is started - quotes will be added
an explicit connection URI will not be set when calling virsh or any of
the virt_ ansible modules.

`libvirt_host_python3`: Whether the python3 version of the libvirt python
bindings should be installed. If `false`, the python 2 bindings will be
installed.

Dependencies
------------

Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ libvirt_host_uri: >-
{%- if libvirt_host_socket_dir -%}
qemu+unix:///system?socket={{ libvirt_host_socket_dir }}/libvirt-sock
{%- endif %}

# Whether the python3 version of the libvirt python bindings should be
# installed. If false, the python 2 bindings will be installed.
libvirt_host_python3: >-
{{ (ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8) or
ansible_python_interpreter | basename is match('python3.*') }}
4 changes: 2 additions & 2 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# List of package dependencies common to all Debian distributions
libvirt_host_libvirt_packages_common:
- qemu-kvm
- python-libvirt
- python-lxml
- "{{ 'python3-libvirt' if libvirt_host_python3 | bool else 'python-libvirt' }}"
- "{{ 'python3-lxml' if libvirt_host_python3 | bool else 'python-lxml' }}"

# Package that contains the libvirt daemon
libvirt_host_libvirt_packages_libvirt_daemon: >-
Expand Down
4 changes: 2 additions & 2 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
libvirt_host_libvirt_packages_default:
- libvirt
- libvirt-daemon-kvm
- "{{ 'python3-libvirt' if ansible_distribution_major_version|int >=8 else 'libvirt-python' }}"
- "{{ 'python3-lxml' if ansible_distribution_major_version|int >=8 else 'python-lxml' }}"
- "{{ 'python3-libvirt' if libvirt_host_python3 | bool else 'libvirt-python' }}"
- "{{ 'python3-lxml' if libvirt_host_python3 | bool else 'python-lxml' }}"
- qemu-kvm

# Packages that are only necessary if you require EFI support
Expand Down