Copy kubeadm images to separate project

This commit is contained in:
Danny Bessems 2023-01-02 09:13:56 +01:00
parent deb524d1f5
commit f03e0c3bda
3 changed files with 11 additions and 10 deletions

View File

@ -1,5 +1,5 @@
clusterConfiguration:
imageRepository: registry.<fqdn>/library
imageRepository: registry.<fqdn>/kubeadm
files:
- [...]

View File

@ -1,3 +1,4 @@
- import_tasks: hypervisor.yml
- import_tasks: registry.yml
- import_tasks: clusterapi.yml
- import_tasks: nodetemplates.yml

View File

@ -23,15 +23,15 @@
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 }}"
- 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=library/{{ 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: