41 lines
1.5 KiB
YAML
41 lines
1.5 KiB
YAML
|
- block:
|
||
|
|
||
|
- name: Create dedicated kubeadm project within container registry
|
||
|
ansible.builtin.uri:
|
||
|
url: https://registry.{{ vapp['metacluster.fqdn'] }}/api/v2.0/projects
|
||
|
method: POST
|
||
|
headers:
|
||
|
Authorization: "Basic {{ ('admin:' + vapp['metacluster.password']) | b64encode }}"
|
||
|
body:
|
||
|
project_name: kubeadm
|
||
|
public: true
|
||
|
storage_limit: 0
|
||
|
metadata:
|
||
|
enable_content_trust: 'false'
|
||
|
enable_content_trust_cosign: 'false'
|
||
|
auto_scan: 'true'
|
||
|
severity: none
|
||
|
prevent_vul: 'false'
|
||
|
public: 'true'
|
||
|
reuse_sys_cve_allowlist: 'true'
|
||
|
|
||
|
- name: Lookup kubeadm container images
|
||
|
ansible.builtin.set_fact:
|
||
|
kubeadm_images: "{{ lookup('ansible.builtin.file', '/opt/metacluster/cluster-api/imagelist').splitlines() }}"
|
||
|
|
||
|
# - name: Copy all stored rancher container images to dedicated project
|
||
|
# ansible.builtin.uri:
|
||
|
# url: https://registry.{{ vapp['metacluster.fqdn'] }}/api/v2.0/projects/kubeadm/repositories/{{ ( item | regex_findall('([^:/]+)') )[-2] }}/artifacts?from={{ item | replace('/', '%2F') | replace(':', '%3A') }}
|
||
|
# method: POST
|
||
|
# headers:
|
||
|
# Authorization: "Basic {{ ('admin:' + vapp['metacluster.password']) | b64encode }}"
|
||
|
# body:
|
||
|
# from: "{{ item }}"
|
||
|
# loop: "{{ kubeadm_images }}"
|
||
|
|
||
|
module_defaults:
|
||
|
ansible.builtin.uri:
|
||
|
validate_certs: no
|
||
|
status_code: [200, 201, 409]
|
||
|
body_format: json
|