Inject kubeadm container images
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6c31038b1a
commit
0fd4cbb92f
@ -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 }}"
|
||||
|
26
ansible/roles/assets/tasks/kubeadm.yml
Normal file
26
ansible/roles/assets/tasks/kubeadm.yml
Normal 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
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user