|
14 | 14 | # License for the specific language governing permissions and limitations |
15 | 15 | # under the License. |
16 | 16 |
|
17 | | -# This task file configures insecure registries and ImageContentSourcePolicy |
| 17 | +# This task file configures insecure registries and ImageDigestMirrorSet/ImageTagMirrorSet |
18 | 18 | # Can be used standalone from playbooks that don't need the full openshift_setup role |
19 | 19 |
|
20 | 20 | - name: Add insecure registry |
|
37 | 37 | - "{{ cifmw_update_containers_registry }}" |
38 | 38 | allowedRegistries: "{{ all_registries }}" |
39 | 39 |
|
40 | | -- name: Create a ICSP with repository digest mirrors |
| 40 | +- name: Create ImageDigestMirrorSet repository digest mirrors |
41 | 41 | when: |
42 | 42 | - cifmw_openshift_setup_digest_mirrors is defined |
43 | 43 | - cifmw_openshift_setup_digest_mirrors | length > 0 |
|
46 | 46 | api_key: "{{ cifmw_openshift_token | default(omit)}}" |
47 | 47 | context: "{{ cifmw_openshift_context | default(omit)}}" |
48 | 48 | definition: |
49 | | - apiVersion: operator.openshift.io/v1alpha1 |
50 | | - kind: ImageContentSourcePolicy |
| 49 | + apiVersion: config.openshift.io/v1 |
| 50 | + kind: ImageDigestMirrorSet |
51 | 51 | metadata: |
52 | 52 | name: registry-digest-mirrors |
53 | 53 | spec: |
54 | | - repositoryDigestMirrors: "{{ cifmw_openshift_setup_digest_mirrors }}" |
| 54 | + imageDigestMirrors: "{{ cifmw_openshift_setup_digest_mirrors }}" |
| 55 | + |
| 56 | +# If both ImageDigestMirrorSet and ImageTagMirrorSet are applied to the registries, |
| 57 | +# ITMS acts as a fallback for tag-based pulls, while IDMS provides the primary |
| 58 | +# secure source for digests |
| 59 | +- name: Create ImageTagMirrorSet for tag-based pulls |
| 60 | + when: |
| 61 | + - cifmw_openshift_setup_tag_mirrors is defined |
| 62 | + - cifmw_openshift_setup_tag_mirrors | length > 0 |
| 63 | + kubernetes.core.k8s: |
| 64 | + kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
| 65 | + api_key: "{{ cifmw_openshift_token | default(omit)}}" |
| 66 | + context: "{{ cifmw_openshift_context | default(omit)}}" |
| 67 | + definition: |
| 68 | + apiVersion: config.openshift.io/v1 |
| 69 | + kind: ImageTagMirrorSet |
| 70 | + metadata: |
| 71 | + name: registry-tag-mirrors |
| 72 | + spec: |
| 73 | + imageTagMirrors: "{{ cifmw_openshift_setup_tag_mirrors }}" |
0 commit comments