Add per-distro vars files

The conditionals for packge installation are getting more complex
than can be handled with the ternary operator, so create per distro
vars files to describe these differences.

Change-Id: I3c2164ca8f610fbef88744d9acfca4e926059c81
This commit is contained in:
Dmitriy Rabotyagov 2021-12-30 13:28:01 +02:00 committed by Jonathan Rosser
parent 4d826ad133
commit c42eb3c131
7 changed files with 113 additions and 23 deletions

View File

@ -27,8 +27,8 @@
# Distribution packages which must be installed
# on all hosts when building python wheels.
venv_build_base_distro_package_list: "{{ _venv_build_base_distro_package_list[ansible_facts['os_family'] | lower] }}"
venv_install_base_distro_package_list: "{{ _venv_install_base_distro_package_list[ansible_facts['os_family'] | lower] }}"
venv_build_base_distro_package_list: "{{ _venv_build_base_distro_package_list }}"
venv_install_base_distro_package_list: "{{ _venv_install_base_distro_package_list }}"
# Distribution packages which must be installed
# on the host for the purpose of building the

View File

@ -13,6 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Gather variables for each operating system
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_version'].split('.')[0] }}.yml"
- "{{ ansible_facts['os_family'] | lower }}.yml"
paths:
- "{{ role_path }}/vars"
tags:
- always
- name: gather build target facts
setup:
gather_subset: '!all:min'

26
vars/debian.yml Normal file
View File

@ -0,0 +1,26 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
_venv_build_base_distro_package_list:
- cmake
- g++
- python3-pkgconfig
- python3-dev
- python3-venv
- python3-setuptools
_venv_install_base_distro_package_list:
- python3-venv
- python3-setuptools

View File

@ -13,27 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
_venv_build_base_distro_package_list:
debian:
- cmake
- g++
- "{{ (venv_python_executable == 'python2') | ternary('pkg-config', 'python3-pkgconfig') }}"
- "{{ (venv_python_executable == 'python2') | ternary('python-dev', 'python3-dev') }}"
- python3-venv
- python3-setuptools
redhat:
- autoconf
- cmake
- gcc
- gcc-c++
- "{{ (venv_python_executable == 'python2') | ternary('python2-devel', 'python3-devel') }}"
_venv_install_base_distro_package_list:
debian:
- python3-venv
- python3-setuptools
redhat: []
# Set the available build targets for all nodes within an environment.
# build targets are grouped based on operating system and CPU
# architecture.

23
vars/redhat-7.yml Normal file
View File

@ -0,0 +1,23 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
_venv_build_base_distro_package_list:
- autoconf
- cmake
- gcc
- gcc-c++
- "{{ (venv_python_executable == 'python2') | ternary('python2-devel', 'python3-devel') }}"
_venv_install_base_distro_package_list: []

23
vars/redhat-8.yml Normal file
View File

@ -0,0 +1,23 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
_venv_build_base_distro_package_list:
- autoconf
- cmake
- gcc
- gcc-c++
- python36-devel
_venv_install_base_distro_package_list: []

23
vars/redhat-9.yml Normal file
View File

@ -0,0 +1,23 @@
---
# Copyright 2018, Rackspace US, Inc.
#
# 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.
_venv_build_base_distro_package_list:
- autoconf
- cmake
- gcc
- gcc-c++
- python3-devel
_venv_install_base_distro_package_list: []