Define a standard commandline for applying manifests

This is expected to be used in the command module this way:
command:
  cmd: "{{ kubectl_apply_stdin }}"
  stdin: <... rendered manifests > -> using the 'template' lookup plugin
  in most cases.

The advantages over the kube plugin module integrated in kubespray
(which this should replace eventually):
- way easier to modify to take advantage of new features (server-side
  apply for instance)
- no need for a separate template tasks + checking the result (which can
  introduce problem if the first playbook runs encounters an error).
This commit is contained in:
Max Gautier 2024-11-09 15:21:20 +01:00
parent 70c73f153b
commit 990d2a1358
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View File

@ -0,0 +1,2 @@
---
namespace: kube-system

View File

@ -0,0 +1,2 @@
---
kubectl_apply_stdin: "{{ kubectl }} apply -f - -n {{ namespace }}"