diff --git a/roles/discover_latest_image/defaults/main.yml b/roles/discover_latest_image/defaults/main.yml index d76c458a8f..89bbf735ac 100644 --- a/roles/discover_latest_image/defaults/main.yml +++ b/roles/discover_latest_image/defaults/main.yml @@ -21,3 +21,4 @@ cifmw_discover_latest_image_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}" cifmw_discover_latest_image_base_url: https://cloud.centos.org/centos/{{ ansible_distribution_major_version }}-stream/x86_64/images/ cifmw_discover_latest_image_qcow_prefix: CentOS-Stream-GenericCloud- cifmw_discover_latest_image_images_file: CHECKSUM +cifmw_discover_latest_image_prefix: "cifmw_discovered" diff --git a/roles/discover_latest_image/tasks/main.yml b/roles/discover_latest_image/tasks/main.yml index 3bc5d6dc40..ca0d05a6da 100644 --- a/roles/discover_latest_image/tasks/main.yml +++ b/roles/discover_latest_image/tasks/main.yml @@ -23,8 +23,8 @@ - name: Export facts accordingly ansible.builtin.set_fact: - cifmw_discovered_image_name: "{{ discovered_image['data']['image_name'] }}" - cifmw_discovered_image_url: "{{ discovered_image['data']['image_url'] }}" - cifmw_discovered_hash: "{{ discovered_image['data']['hash'] }}" - cifmw_discovered_hash_algorithm: "{{ discovered_image['data']['hash_algorithm'] }}" + "{{ cifmw_discover_latest_image_prefix }}_image_name": "{{ discovered_image['data']['image_name'] }}" + "{{ cifmw_discover_latest_image_prefix }}_image_url": "{{ discovered_image['data']['image_url'] }}" + "{{ cifmw_discover_latest_image_prefix }}_hash": "{{ discovered_image['data']['hash'] }}" + "{{ cifmw_discover_latest_image_prefix }}_hash_algorithm": "{{ discovered_image['data']['hash_algorithm'] }}" cacheable: true diff --git a/roles/reproducer/README.md b/roles/reproducer/README.md index 772e78b2a0..084b4999dc 100644 --- a/roles/reproducer/README.md +++ b/roles/reproducer/README.md @@ -24,6 +24,7 @@ None * `cifmw_reproducer_skip_fetch_repositories`: (Bool) Skip fetching repositories from zuul var and simply copy the code from the ansible controller. Defaults to `false`. * `cifmw_reproducer_supported_hypervisor_os`: (List) List of supported hypervisor operating systems and their minimum version. * `cifmw_reproducer_minimum_hardware_requirements`: (Dict) Define minimum hardware requirements for specific scenarios. Example below +* `cifmw_reproducer_computes_rhos_release_args`: (String) Arguments to use when installing rhos-release repos on compute nodes. Not defined by default, and `cifmw_repo_setup_rhos_release_args` is used instead. ### Advanced parameters Those parameters shouldn't be used, unless the user is able to understand potential issues in their environment. diff --git a/roles/reproducer/defaults/main.yml b/roles/reproducer/defaults/main.yml index 504f305341..a9393fa6ae 100644 --- a/roles/reproducer/defaults/main.yml +++ b/roles/reproducer/defaults/main.yml @@ -40,6 +40,7 @@ cifmw_reproducer_supported_hypervisor_os: minimum_version: 9 RedHat: minimum_version: 9.3 +cifmw_reproducer_discover_extra_vm_images: {} # Allow to disable validations - user toggle this at their # own risks! diff --git a/roles/reproducer/tasks/configure_computes.yml b/roles/reproducer/tasks/configure_computes.yml index 95c81347d2..091b5e127d 100644 --- a/roles/reproducer/tasks/configure_computes.yml +++ b/roles/reproducer/tasks/configure_computes.yml @@ -47,6 +47,8 @@ - cifmw_repo_setup_rhos_release_rpm is defined block: - name: Get rhos-release and setup repos + vars: + _rhos_release_args_override: "{{ cifmw_reproducer_computes_rhos_release_args }}" ansible.builtin.include_tasks: rhos_release.yml - name: Create repositories on computes diff --git a/roles/reproducer/tasks/main.yml b/roles/reproducer/tasks/main.yml index deebf619d0..23620e02b1 100644 --- a/roles/reproducer/tasks/main.yml +++ b/roles/reproducer/tasks/main.yml @@ -21,6 +21,23 @@ ansible.builtin.import_role: name: discover_latest_image +- name: Discover extra VM type images + tags: + - bootstrap + - bootstrap_layout + when: + - cifmw_reproducer_discover_extra_vm_images | default({}) | length > 0 + ansible.builtin.include_role: + name: discover_latest_image + vars: + cifmw_discover_latest_image_base_url: "{{ item.value.base_url }}" + cifmw_discover_latest_image_qcow_prefix: "{{ item.value.qcow_prefix }}" + cifmw_discover_latest_image_images_file: "{{ item.value.images_file }}" + cifmw_discover_latest_image_prefix: "{{ item.value.prefix }}" + loop: "{{ cifmw_reproducer_discover_extra_vm_images | dict2items }}" + loop_control: + label: "{{ item.key }}" + - name: Load CI job environment tags: - bootstrap_layout diff --git a/roles/reproducer/tasks/rhos_release.yml b/roles/reproducer/tasks/rhos_release.yml index 752d1c8caf..144094c8a2 100644 --- a/roles/reproducer/tasks/rhos_release.yml +++ b/roles/reproducer/tasks/rhos_release.yml @@ -7,7 +7,7 @@ - name: Install repos ansible.builtin.command: - cmd: "rhos-release {{ cifmw_repo_setup_rhos_release_args | default('rhel') }}" + cmd: "rhos-release {{ _rhos_release_args_override | default(cifmw_repo_setup_rhos_release_args) | default('rhel') }}" - name: Run custom commands after rhos-release setup ansible.builtin.command: