From 23e69f324553372e573f934616561ce097516452 Mon Sep 17 00:00:00 2001 From: Douglas Viroel Date: Wed, 10 Jul 2024 18:29:23 -0300 Subject: [PATCH] Call rhos-release command only with rhos_release_args The reproducer role is configuring repositories twice, and one of them has 'rhel' args hardcoded. This is a problem when we need to configure a different release version since it end up with duplicated repositories. --- roles/reproducer/tasks/configure_computes.yml | 9 +-------- roles/reproducer/tasks/configure_controller.yml | 2 +- roles/reproducer/tasks/rhos_release.yml | 7 +++++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/roles/reproducer/tasks/configure_computes.yml b/roles/reproducer/tasks/configure_computes.yml index d00e238eb1..7b47151699 100644 --- a/roles/reproducer/tasks/configure_computes.yml +++ b/roles/reproducer/tasks/configure_computes.yml @@ -31,16 +31,9 @@ - cifmw_reproducer_compute_set_repositories | bool - cifmw_repo_setup_rhos_release_rpm is defined block: - - name: Get rhos-release + - name: Get rhos-release and setup repos ansible.builtin.include_tasks: rhos_release.yml - - name: Configure rhos-release - register: _async_rhos_release - async: 120 # 2 minutes should be enough? - poll: 0 - ansible.builtin.command: - cmd: "rhos-release {{ cifmw_repo_setup_rhos_release_args }}" - - name: Create repositories on computes become: true ansible.builtin.yum_repository: diff --git a/roles/reproducer/tasks/configure_controller.yml b/roles/reproducer/tasks/configure_controller.yml index 2fec5c08c9..198bf81b49 100644 --- a/roles/reproducer/tasks/configure_controller.yml +++ b/roles/reproducer/tasks/configure_controller.yml @@ -71,7 +71,7 @@ when: - cifmw_repo_setup_rhos_release_rpm is defined block: - - name: Get rhos-release + - name: Get rhos-release and setup repos ansible.builtin.import_tasks: rhos_release.yml - name: Create bundle for CRC diff --git a/roles/reproducer/tasks/rhos_release.yml b/roles/reproducer/tasks/rhos_release.yml index 51f9eeab24..2b2e9ed34d 100644 --- a/roles/reproducer/tasks/rhos_release.yml +++ b/roles/reproducer/tasks/rhos_release.yml @@ -5,6 +5,9 @@ state: present disable_gpg_check: true -- name: Enable RHEL repos +- name: Install repos + register: _async_rhos_release + async: 120 # 2 minutes should be enough? + poll: 0 ansible.builtin.command: - cmd: "rhos-release rhel" + cmd: "rhos-release {{ cifmw_repo_setup_rhos_release_args | default('rhel') }}"