From 8fa29d9834dcc0eb0f58ff6c6ff69888a0408131 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 18 May 2022 09:55:36 +0200 Subject: [PATCH] Use libvirt-python from the distribution on Red Hat systems The one in PyPI can easily get out of sync, causing breakages. Since Red Hat systems move pretty quickly, just use the system package (Bifrost creates the venv with system site packages). Change-Id: I08da25aa73cdf3dc43886bc746431f6082e804a1 --- .../defaults/required_defaults_CentOS.yml | 3 +-- .../defaults/required_defaults_Fedora.yml | 3 +-- .../defaults/required_defaults_RedHat.yml | 3 +-- .../tasks/prepare_libvirt.yml | 19 +++++++++++++++++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_CentOS.yml b/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_CentOS.yml index 6361fdd31..d16980c9f 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_CentOS.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_CentOS.yml @@ -19,7 +19,6 @@ required_packages: - libvirt-daemon-driver-secret - libvirt-daemon-driver-storage - libvirt-daemon-kvm - - pkgconfig - - libvirt-devel + - python3-libvirt - edk2-ovmf test_vm_emulator: "/usr/libexec/qemu-kvm" diff --git a/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_Fedora.yml b/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_Fedora.yml index 961195ef6..992f814e7 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_Fedora.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_Fedora.yml @@ -9,7 +9,6 @@ required_packages: - libvirt - libvirt-client - libvirt-daemon - - pkgconfig - - libvirt-devel + - python3-libvirt - python3-libselinux - edk2-ovmf diff --git a/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_RedHat.yml b/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_RedHat.yml index 813fb01c0..605745b83 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_RedHat.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/defaults/required_defaults_RedHat.yml @@ -12,8 +12,7 @@ required_packages: - libvirt - libvirt-client - libvirt-daemon - - pkgconfig - - libvirt-devel + - python3-libvirt - libxslt-devel - libxml2-devel - edk2-ovmf diff --git a/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml b/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml index a6f516420..c4ca4971b 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml @@ -22,16 +22,22 @@ - default_boot_mode != 'uefi' - test_vm_secure_boot | bool -- name: install libvirt-python, gunicorn and lxml +- name: install gunicorn and lxml include_role: name: bifrost-pip-install vars: package: "{{ item }}" loop: - - libvirt-python - gunicorn - lxml +- name: install libvirt-python if needed + include_role: + name: bifrost-pip-install + vars: + package: libvirt-python + when: ansible_os_family != 'RedHat' + - name: configure libvirt log filters for qemu blockinfile: path: /etc/libvirt/libvirtd.conf @@ -161,6 +167,15 @@ path: "{{ test_vm_logdir | dirname }}" mode: "0755" +# NOTE(dtantsur): pypi version can easily get out of sync, we need to use +# the version from the distribution. +- name: edit libvirt-python out of upper constraints + lineinfile: + path: "{{ upper_constraints_file }}" + regexp: "^libvirt\\-python" + state: absent + when: ansible_os_family == 'RedHat' + - name: install virtualbmc include_role: name: bifrost-pip-install