From d4c8c4d507292380b991575804043f368ae7dda3 Mon Sep 17 00:00:00 2001 From: Daniil Anfimov Date: Tue, 27 Oct 2026 15:46:37 +0200 Subject: [PATCH] Install ansible-core instead of ansible on EL10 EPEL 10 doesn't ship the ansible bundle package, so the initial provision of EL10 Docker test environments fails with "No package ansible available". Install ansible-core from AppStream together with ansible.posix and community.general collections from EPEL on EL10+ (excluding Fedora). Resolves: AlmaLinux/build-system#562 --- resources/roles/preparation/tasks/rhel.yml | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/resources/roles/preparation/tasks/rhel.yml b/resources/roles/preparation/tasks/rhel.yml index e134782..bb987c5 100644 --- a/resources/roles/preparation/tasks/rhel.yml +++ b/resources/roles/preparation/tasks/rhel.yml @@ -202,7 +202,31 @@ until: pkg_mgr_retry_done | bool retries: "{{ pkg_mgr_retries }}" delay: "{{ pkg_mgr_retry_delay }}" - when: pytest_is_needed | bool + when: > + pytest_is_needed | bool and + (ansible_facts.distribution == 'Fedora' or + ansible_facts.distribution_major_version | int < 10) + ignore_errors: "{{ ignore_ansible_install_errors | bool }}" + +# EPEL 10 doesn't ship the "ansible" bundle, so use ansible-core +# from AppStream plus the most common collections from EPEL +- name: Install ansible-core and collections (10 and higher) + yum: + name: + - ansible-core + - ansible-collection-ansible-posix + - ansible-collection-community-general + state: present + enablerepo: epel + lock_timeout: 300 + register: pkg_mgr_result + until: pkg_mgr_retry_done | bool + retries: "{{ pkg_mgr_retries }}" + delay: "{{ pkg_mgr_retry_delay }}" + when: > + pytest_is_needed | bool and + ansible_facts.distribution != 'Fedora' and + ansible_facts.distribution_major_version | int >= 10 ignore_errors: "{{ ignore_ansible_install_errors | bool }}" - name: Add required repositories