Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tasks to disable libvirt modular systemd units by default #77

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
24 changes: 24 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,27 @@ libvirt_host_vnc_tls_enabled: false

# Whether to configure AppArmor for directory storage pools.
libvirt_host_configure_apparmor: "{{ libvirt_host_install_daemon | bool }}"

# Whether to disable and mask libvirt modular systemd units
# See: https://libvirt.org/daemons.html
libvirt_disable_modular_systemd_units: true

# A list of libvirt modular daemon drivers
libvirtd_modular_daemon_drivers:
- qemu
- interface
- network
- nodedev
- nwfilter
- proxy
- secret
- storage

# A list of libvirt modular systemd services.
# The {driver} replacement string is populated
# from libvirtd_modular_daemon_drivers.
libvirtd_modular_services:
- virt{driver}d.service
- virt{driver}d.socket
- virt{driver}d-ro.socket
- virt{driver}d-admin.socket
4 changes: 4 additions & 0 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,7 @@
enabled: "{{ libvirt_host_tls_listen | bool }}"
- service: libvirtd
enabled: true

- name: Disable libvirt modular systemd units
include_tasks: disable-modular-systemd-units.yml
when: libvirt_disable_modular_systemd_units
13 changes: 13 additions & 0 deletions tasks/disable-modular-systemd-units.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---

- name: Disable and mask libvirtd modular systemd services and sockets
systemd:
name: "{{ service_name }}"
state: stopped
enabled: false
masked: true
loop: "{{ libvirtd_modular_daemon_drivers | product(libvirtd_modular_services) }}"
vars:
service_name: "{{ item[1].format(driver=item[0]) }}"
loop_control:
label: "{{ service_name }}"