Skip to content

Commit

Permalink
Disable bootstrap image when mock version is 5 or higher
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eduolivares committed Nov 27, 2023
1 parent ba19efd commit f736bf8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/patch_rpm/tasks/patch_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f736bf8

Please sign in to comment.