Right now role logic relies on existance of the `egg` fragment in package name for installation, when wheels are pre-build. With `egg` is deprecated for a while, and Direct References[1] should be replacing it. This adds support for both formats while transitional period is ongoing. [1] https://packaging.python.org/en/latest/specifications/version-specifiers/#direct-references Change-Id: I1133a597fd5bfc87c89038e10ea98299226d4272 Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
---
|
|
# Copyright 2026, Cleura AB.
|
|
#
|
|
# 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: Copy constraints to the containers when needed
|
|
hosts: all
|
|
tasks:
|
|
- name: Install required packages
|
|
vars:
|
|
_install_packages:
|
|
redhat:
|
|
- git-core
|
|
debian:
|
|
- git
|
|
ansible.builtin.package:
|
|
name: "{{ _install_packages[ansible_facts['os_family'] | lower] }}"
|
|
state: present
|
|
update_cache: true
|
|
|
|
- name: Copy constraints to the host when it's a file
|
|
when: not ('http' in molecule_build_constraints or 'https' in molecule_build_constraints)
|
|
block:
|
|
- name: Create destination directory
|
|
ansible.builtin.file:
|
|
path: "{{ molecule_build_constraints | dirname }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Copy the constraints file
|
|
ansible.builtin.copy:
|
|
src: "{{ molecule_build_constraints }}"
|
|
dest: "{{ molecule_build_constraints }}"
|
|
mode: "0755"
|
|
|
|
- name: Deploy a web server for wheels
|
|
hosts: httpd
|
|
roles:
|
|
- role: httpd
|