Commit Graph

3 Commits

Author SHA1 Message Date
Max Gautier
e7f4c9f9f6 kubeadm_patches: remove old patches on inventory change (#13019)
Currently, if changing the inventory variable `kubeadm_patches`, new
patches will be created, but the existing ones will also be left on the
filesystem, and applied by kubeadm ; this means that removed or changed
configuration can linger.

Cleanup old patches (which are the difference between existing patches
on filesystem and the one created for the current runs).
2026-02-17 09:56:01 +05:30
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
Max Gautier
a8b66fd207 Deduplicate kubeadm_patches tasks
kubernetes/control-plane and kubernetes/kubeadm roles both push kubeadm
patches in the same way.
Extract that code and make it a dependency of both.
This is safe because it's only configuration for kubeadm, which only
takes effect when kubeadm is run.
2024-09-10 17:39:31 +02:00