Files
kubespray/roles/kubernetes/kubeadm_common/tasks/main.yml
Max Gautier 8e254ec1e8 kubeadm: allow to provide patch inline in inventories
Specifying one directory for kubeadm patches is not ideal:
1. It does not allow working with multiples inventories easily
2. No ansible templating of the patch
3. Ansible path searching can sometimes be confusing

Instead, provide the patch directly in a variable, and add some quality
of life to handle components targeting and patch ordering more
explicitly (`target` and `type` which are translated to the kubeadm
scheme which is based on the file name)
2024-09-10 20:37:14 +02:00

18 lines
507 B
YAML

---
- name: Kubeadm | Create directory to store kubeadm patches
file:
path: "{{ kubeadm_patches_dir }}"
state: directory
mode: "0640"
when: kubeadm_patches | length > 0
- name: Kubeadm | Copy kubeadm patches from inventory files
copy:
content: "{{ item.patch | to_yaml }}"
dest: "{{ kubeadm_patches_dir }}/{{ item.target }}{{ suffix }}+{{ item.type | d('strategic') }}.yaml"
owner: "root"
mode: "0644"
loop: "{{ kubeadm_patches }}"
loop_control:
index_var: suffix