From f736bf8bb77d2eb05805daa582df9cb0dbc50c18 Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Fri, 24 Nov 2023 16:12:00 +0100 Subject: [PATCH] Disable bootstrap image when mock version is 5 or higher The command `rhpkg mockbuild` fails when mock version is 5 or higher because it tries to pull a fedora image. This is resolved by disabling the configuration parameter use_bootstrap_image from mock configuration. RHOSINFRA-5432 Change-Id: Ia7507921d9e979914b14532ac7ef0df2be5bc2cd --- roles/patch_rpm/tasks/patch_component.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/roles/patch_rpm/tasks/patch_component.yml b/roles/patch_rpm/tasks/patch_component.yml index b89f964..3f1be1a 100644 --- a/roles/patch_rpm/tasks/patch_component.yml +++ b/roles/patch_rpm/tasks/patch_component.yml @@ -57,6 +57,18 @@ - skip_ansible_lint when: install.component.version|int == component_pre_rel_version|int +- name: Update ansible_facts.packages + package_facts: + +- name: Disable use_bootstrap_image from mock configuration if version is higher than 5 + become: yes + lineinfile: + path: "/etc/mock/site-defaults.cfg" + regex: >- + ^config_opts\['use_bootstrap_image'\] + line: "config_opts['use_bootstrap_image'] = False" + when: ansible_facts.packages.mock[0].version is version("5.0", ">=") + # Now that the repo is patched, generate RPMs from it - block: - name: Build new RPM from patched dist-git repo