Add override custom libvirtd.service unit

This has no functional change on Buster, but on Bullseye this overrides
the stupid socket-based activation shenanigans that the default unit
tries to do, as well as the breaking replacement of the
/etc/default/libvirt variable names.
This commit is contained in:
2023-09-01 15:42:26 -04:00
parent 3a67dc129b
commit 0bbb91fc8b
2 changed files with 58 additions and 3 deletions

View File

@ -49,17 +49,28 @@
replace: 'libvirtd_opts="--listen"'
notify: restart libvirtd
- name: enable services
- name: install systemd unit file (override default on Bullseye)
template:
src: libvirt/libvirtd.service.j2
dest: /etc/systemd/system/libvirtd.service
register: systemd
- name: reload systemd to apply changes
command: systemctl daemon-reload
when: systemd.changed
- name: start and enable services (not managed by PVC)
service:
name: "{{ item }}"
enabled: yes
state: started
enabled: yes
with_items:
- vhostmd
- name: disable PVC-managed services
- name: start but disable services (managed by PVC)
service:
name: "{{ item }}"
state: started
enabled: no
with_items:
- libvirtd