Skip to content

Commit 8fbf801

Browse files
committed
Add support for installing additional packages
Separate package lists are provided for client & daemon hosts. * libvirt_host_extra_daemon_packages * libvirt_host_extra_client_packages
1 parent 004f2d0 commit 8fbf801

File tree

7 files changed

+37
-31
lines changed

7 files changed

+37
-31
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ daemon. Default is `true`.
103103
`libvirt_host_install_client`: Whether to install and enable the libvirt
104104
client. Default is `true`.
105105

106+
`libvirt_host_extra_daemon_packages`: List of additional packages to install on
107+
libvirt daemon hosts.
108+
109+
`libvirt_host_extra_client_packages`: List of additional packages to install on
110+
libvirt client hosts.
111+
106112
`libvirt_host_libvirtd_conf_enabled`: Whether to configure `libvirtd.conf`.
107113
Default is `true`.
108114

defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ libvirt_host_install_daemon: true
7474
# Whether to install and enable the libvirt client.
7575
libvirt_host_install_client: true
7676

77+
# List of additional packages to install on libvirt daemon hosts.
78+
libvirt_host_extra_daemon_packages: []
79+
80+
# List of additional packages to install on libvirt client hosts.
81+
libvirt_host_extra_client_packages: []
82+
7783
# Whether to configure libvirtd.conf.
7884
libvirt_host_libvirtd_conf_enabled: true
7985
# Configuration for libvirtd.conf. Dict mapping option names to values.

tasks/install-client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Ensure libvirt client packages are installed
33
package:
4-
name: "{{ libvirt_host_libvirt_packages_client }}"
4+
name: "{{ libvirt_host_libvirt_packages_client | select | list }}"
55
state: present
66
register: result
77
until: result is success

vars/Archlinux.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
# List of package dependencies common to all Debian distributions
2+
# List of default daemon packages to install.
33
libvirt_host_libvirt_packages_default:
44
- libvirt
55
- qemu-headless
66
- ebtables
77
- dnsmasq
88

9-
# List of all client packages to install.
10-
libvirt_host_libvirt_packages_client:
9+
# List of default client packages to install.
10+
libvirt_host_libvirt_packages_client_default:
1111
- libvirt
1212
- libvirt-python
1313
- python-lxml
@@ -16,13 +16,6 @@ libvirt_host_libvirt_packages_client:
1616
libvirt_host_packages_efi:
1717
- ovmf
1818

19-
# List of all packages to install
20-
libvirt_host_libvirt_packages: >
21-
{{ libvirt_host_libvirt_packages_default +
22-
libvirt_host_libvirt_packages_client +
23-
(libvirt_host_packages_efi if libvirt_host_enable_efi_support else []) | unique
24-
}}
25-
2619
# Packages for RBD volume pool support
2720
libvirt_host_packages_rbd_volume_pool:
2821
- libvirt-storage-rbd

vars/Debian.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ libvirt_host_libvirt_packages_libvirt_daemon:
1717
libvirt-daemon-system
1818
{%- endif -%}
1919
20-
# List of all client packages to install.
21-
libvirt_host_libvirt_packages_client:
20+
# List of default daemon packages to install.
21+
libvirt_host_libvirt_packages_default: "{{ libvirt_host_libvirt_packages_common + libvirt_host_libvirt_packages_libvirt_daemon }}"
22+
23+
# List of default client packages to install.
24+
libvirt_host_libvirt_packages_client_default:
2225
- libvirt-clients
2326
- "{{ 'python3-libvirt' if libvirt_host_python3 | bool else 'python-libvirt' }}"
2427
- "{{ 'python3-lxml' if libvirt_host_python3 | bool else 'python-lxml' }}"
@@ -27,14 +30,6 @@ libvirt_host_libvirt_packages_client:
2730
libvirt_host_packages_efi:
2831
- ovmf
2932

30-
# List of all packages to install
31-
libvirt_host_libvirt_packages: >
32-
{{ libvirt_host_libvirt_packages_common +
33-
libvirt_host_libvirt_packages_libvirt_daemon +
34-
libvirt_host_libvirt_packages_client +
35-
(libvirt_host_packages_efi if libvirt_host_enable_efi_support else []) | unique
36-
}}
37-
3833
# Packages for RBD volume pool support
3934
libvirt_host_packages_rbd_volume_pool:
4035
- libvirt-daemon-driver-storage-rbd

vars/RedHat.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
# List of libvirt package dependencies.
2+
# List of default daemon packages to install.
33
libvirt_host_libvirt_packages_default:
44
# NOTE(mgoddard): CentOS 8.3 has a bug in which updating qemu-kvm does not
55
# update libgcrypt. This leads to failues when using libvirt/qemu. See
@@ -10,8 +10,8 @@ libvirt_host_libvirt_packages_default:
1010
- libvirt-daemon-kvm
1111
- qemu-kvm
1212

13-
# List of all client packages to install.
14-
libvirt_host_libvirt_packages_client:
13+
# List of default client packages to install.
14+
libvirt_host_libvirt_packages_client_default:
1515
- libvirt-client
1616
- "{{ 'python3-libvirt' if libvirt_host_python3 | bool else 'libvirt-python' }}"
1717
- "{{ 'python3-lxml' if libvirt_host_python3 | bool else 'python-lxml' }}"
@@ -27,13 +27,6 @@ libvirt_host_packages_efi_by_version:
2727
libvirt_host_packages_efi: >-
2828
{{ libvirt_host_packages_efi_by_version[ansible_facts.distribution_major_version | int] }}
2929
30-
# List of all packages to install
31-
libvirt_host_libvirt_packages: >
32-
{{ libvirt_host_libvirt_packages_default +
33-
libvirt_host_libvirt_packages_client +
34-
(libvirt_host_packages_efi if libvirt_host_enable_efi_support else []) | unique
35-
}}
36-
3730
# Packages for RBD volume pool support
3831
libvirt_host_packages_rbd_volume_pool:
3932
- libvirt-daemon-driver-storage-rbd

vars/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
---
2+
# List of all packages to install for daemon hosts.
3+
libvirt_host_libvirt_packages: >
4+
{{ libvirt_host_libvirt_packages_default +
5+
libvirt_host_extra_daemon_packages +
6+
libvirt_host_libvirt_packages_client +
7+
(libvirt_host_packages_efi if libvirt_host_enable_efi_support else []) | unique
8+
}}
9+
10+
# List of all packages to install for client hosts.
11+
libvirt_host_libvirt_packages_client: >-
12+
{{ libvirt_host_libvirt_packages_client_default +
13+
libvirt_host_extra_client_packages }}
14+
215
# List of socket services.
316
_libvirt_socket_services:
417
- service: libvirtd-tcp.socket

0 commit comments

Comments
 (0)