2022-12-31 12:11:33 +00:00
|
|
|
- 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:
|
2023-01-01 12:39:23 +00:00
|
|
|
cmd: "{{ kubeadm.path }}/kubeadm config images list --kubernetes-version {{ components.clusterapi.workload.version.k8s }}"
|
2022-12-31 12:11:33 +00:00
|
|
|
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
|