Fix libsystemd version for Centos

This is used by python_systemd wheel build which breaks when the
version string is read from pkg-config

Centos-8:

pkg-config --modversion libsystemd
239 (239-41.el8_3)

Bionic:

pkg-config --modversion libsystemd
237

This causes the C preprocessor to fail when building the wheel
http://paste.openstack.org/show/800825/ as the string returned on
centos cannot be used in a preprocessor version comparison.

This can be fixed by setting the environment variable LIBSYSTEMD_VERSION
which will be used by the python_systemd setup.py script in prefernce
to the value from pkg-config

In addition this patch changed the following for centos 8.3 which are
necessary to pass tests.

1. CentOS 8.3 merged nf_conntrack_ipv4/6 into nf_conntrack
2. CentOS 8.3 PowerTools repo use lowercase for name.

Change-Id: I3fb3080c69307b38e21735d431b55eefa221f12c
This commit is contained in:
Jonathan Rosser 2020-12-08 15:49:50 +00:00 committed by Dmitriy Rabotyagov
parent 6e949f8e8b
commit 0bd4c0295e
5 changed files with 44 additions and 4 deletions

View File

@ -103,3 +103,8 @@
- import_tasks: openstack_hosts_ca_certificates.yml
tags:
- openstack_hosts-config
- import_tasks: openstack_update_environment.yml
tags:
- openstack_hosts-config
when: ansible_distribution == 'CentOS'

View File

@ -102,7 +102,7 @@
- (install_method | default('source')) == 'distro'
- name: Enable PowerTools repository
command: dnf config-manager --set-enabled PowerTools
command: dnf config-manager --set-enabled "[Pp]ower[Tt]ools"
changed_when: false
when:
- openstack_hosts_power_tool_enable | bool

View File

@ -0,0 +1,27 @@
---
# Copyright 2020, BBC R&D
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Pull systemd version
command: "rpm -q systemd"
changed_when: false
register: systemd_version
tags:
- skip_ansible_lint
- always
- name: Update environment file
lineinfile:
path: /etc/environment
line: "LIBSYSTEMD_VERSION={{ systemd_version.stdout_lines[0].split('-')[1] }}"

View File

@ -40,11 +40,11 @@ openstack_host_kernel_modules:
- name: ip_vs
- name: iscsi_tcp
- name: nf_conntrack
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.19', '<=')) | ternary('nf_conntrack_ipv4' ,'') }}"
- name: "{{ (hostvars[inventory_hostname]['ansible_kernel'] is version('4.19', '<=')) | ternary('nf_conntrack_ipv6' ,'') }}"
- name: "{{ ansible_distribution_version is version('8.3', '<') | ternary('nf_conntrack_ipv4', '') }}"
- name: "{{ ansible_distribution_version is version('8.3', '<') | ternary('nf_conntrack_ipv6', '') }}"
- name: nf_defrag_ipv4
- name: nf_nat
- name: nf_nat_ipv4
- name: "{{ ansible_distribution_version is version('8.3', '<') | ternary('nf_nat_ipv4', '') }}"
- name: vhost_net
## Base packages

View File

@ -21,3 +21,11 @@
- check-requirements
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- openstack-ansible-deploy-aio_metal-centos-8:
voting: false
gate:
jobs:
- openstack-ansible-deploy-aio_metal-centos-8:
voting: false