Use py3 for CentOS

Unfortunatelly CentOS 7 do not have libvirt and guestfs libraries
for py3, so isntead of symlinking them, we have to install devel package
and build inside venv.

Change-Id: Ie678e44c2369347cf0816cbcc4269de8eba7b963
This commit is contained in:
Dmitriy Rabotyagov 2019-12-20 21:00:47 +02:00
parent 1de7b24e70
commit e72835e5ac
2 changed files with 27 additions and 5 deletions

View File

@ -61,6 +61,21 @@
value: "{{ nova_venv_tag }}"
when: nova_install_method == 'source'
# NOTE(noonedeadpunk): This task can't be done in python_venv_build role
# because installation from file/url can't be used with constraints.
# Here we install packages which are missing in disto, so can't be
# symlinked inside venv.
- name: Install kvm pip packages
pip:
name: "{{ nova_compute_kvm_pip_packages }}"
virtualenv: "{{ nova_bin | dirname }}"
state: present
when:
- nova_install_method == 'source'
- nova_services['nova-compute']['group'] in group_names
- ansible_os_family | lower == 'redhat'
- ansible_distribution_major_version|int <= 7
- include_tasks: "consoles/nova_console_{{ nova_console_type }}_install.yml"
when:
- "nova_services['nova-novncproxy']['group'] in group_names or

View File

@ -62,15 +62,22 @@ nova_compute_kvm_distro_packages:
- libvirt-daemon-kvm
- "qemu-kvm{% if ansible_distribution_major_version|int <= 7 %}-ev{% endif %}"
- libvirt-client
- libvirt-python
- "{{ (ansible_distribution_major_version|int <= 7) | ternary('libvirt-devel', 'python3-libvirt') }}"
- nfs-utils
- python-libguestfs
- "{{ (ansible_distribution_major_version|int <= 7) | ternary('libguestfs-devel', 'python3-libguestfs') }}"
- "qemu-img{% if ansible_distribution_major_version|int <= 7 %}-ev{% endif %}"
- "{{ (ansible_architecture == 'aarch64') | ternary('AAVMF', 'OVMF') }}"
nova_compute_kvm_packages_to_symlink:
- "{% if ansible_distribution_major_version|int <= 7 %}libvirt-python{% else %}python2-libvirt{% endif %}"
- "python{% if ansible_distribution_major_version|int > 7 %}2{% endif %}-libguestfs"
nova_compute_kvm_packages_to_symlink: |-
{% set packages = [] %}
{% if ansible_distribution_major_version|int > 7 %}
{% set _ = packages.extend(['python3-libvirt', 'python3-libguestfs']) %}
{% endif %}
{{ packages }}
nova_compute_kvm_pip_packages:
- http://download.libguestfs.org/python/guestfs-1.40.2.tar.gz
- libvirt-python
nova_compute_ksm_packages:
- ksmtuned