Mohammed Naser | 564caa8 | 2025-01-18 15:49:44 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | - name: Configure CI registry |
| 4 | hosts: all |
| 5 | tasks: |
| 6 | - name: Replace the registry in image manifest |
| 7 | ansible.builtin.replace: |
| 8 | path: "{{ zuul.project.src_dir }}/roles/defaults/vars/main.yml" |
| 9 | regexp: "{{ zj_zuul_artifact.metadata.repository | regex_replace('/ci/', '/library/', 1) }}:.*" |
| 10 | replace: '{{ zj_zuul_artifact.metadata.repository }}:{{ zj_zuul_artifact.metadata.tag }}"' |
| 11 | loop: "{{ zuul.artifacts | default([]) }}" |
| 12 | loop_control: |
| 13 | loop_var: zj_zuul_artifact |
| 14 | when: |
| 15 | - "'metadata' in zj_zuul_artifact" |
| 16 | - "zj_zuul_artifact.metadata.type | default('') == 'container_image'" |
| 17 | |
| 18 | - name: Print out the new image manifest file |
| 19 | ansible.builtin.command: | |
| 20 | cat {{ zuul.project.src_dir }}/roles/defaults/vars/main.yml |