Inject kubeadm container images
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2022-12-31 13:11:33 +01:00
parent 6c31038b1a
commit 0fd4cbb92f
3 changed files with 30 additions and 1 deletions

View File

@ -30,6 +30,8 @@
loop:
- source: charts
results: "{{ containerimages | json_query('results[*].stdout_lines') | select() | flatten | list }}"
- source: kubeadm
results: "{{ kubeadmimages | json_query('results[*].stdout_lines') | select() | flatten | list }}"
- source: manifests
results: "{{ parsedmanifests | json_query('results[*].stdout_lines') | select() | flatten | list }}"
loop_control:
@ -44,4 +46,4 @@
docker://{{ item }} \
docker-archive:./{{ ( item | regex_findall('[^/:]+'))[-2] }}_{{ lookup('ansible.builtin.password', '/dev/null length=5 chars=ascii_lowercase,digits seed={{ item }}') }}.tar:{{ item }}
chdir: /opt/metacluster/container-images
loop: "{{ (containerimages_charts + containerimages_manifests + dependencies.container_images) | flatten | unique | sort }}"
loop: "{{ (containerimages_charts + containerimages_manifests + containerimages_kubeadm + dependencies.container_images) | flatten | unique | sort }}"

View File

@ -0,0 +1,26 @@
- name: Initialize tempfile
ansible.builtin.tempfile:
state: directory
register: kubeadm
- name: Download kubeadm binary
ansible.builtin.get_url:
url: https://dl.k8s.io/release/{{ components.clusterapi.workload.version.k8s }}/bin/linux/amd64/kubeadm
dest: "{{ kubeadm.path }}/kubeadm"
mode: u+x
- name: Retrieve container images list
ansible.builtin.shell:
cmd: "{{ kubeadm.path }}/kubeadm config images list"
register: kubeadmimages
- name: Store list of container images for reference
ansible.builtin.copy:
dest: /opt/metacluster/cluster-api/imagelist
content: "{{ kubeadmimages.stdout }}"
- name: Cleanup tempfile
ansible.builtin.file:
path: "{{ kubeadm.path }}"
state: absent
when: kubeadm.path is defined

View File

@ -23,5 +23,6 @@
- import_tasks: helm.yml
- import_tasks: git.yml
- import_tasks: manifests.yml
- import_tasks: kubeadm.yml
- import_tasks: containerimages.yml
- import_tasks: nodetemplates.yml