Packer.Images/ansible/roles/assets/tasks/kubeadm.yml
Danny Bessems deb524d1f5
All checks were successful
continuous-integration/drone/push Build is passing
Pin version for kubeadm container images
2023-01-01 13:39:23 +01:00

27 lines
836 B
YAML

- 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 --kubernetes-version {{ components.clusterapi.workload.version.k8s }}"
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