summaryrefslogtreecommitdiff
path: root/roles/kubernetes/kubeadm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-08-19 19:47:09 +0200
committerChristian Pointner <equinox@spreadspace.org>2022-08-19 19:47:09 +0200
commit8dabe0fc460a6772899efcba7e8a90dc9e24e08d (patch)
tree2b6b21c2815001e5addfd9fa28709a2469b288fc /roles/kubernetes/kubeadm
parentremove old nginx vhost templates (diff)
kubernetes/kubeadm: fix upload-certs for secondary control-plane nodes if custom kubernetes names are used
Diffstat (limited to 'roles/kubernetes/kubeadm')
-rw-r--r--roles/kubernetes/kubeadm/control-plane/tasks/secondary.yml4
1 files changed, 2 insertions, 2 deletions
diff --git a/roles/kubernetes/kubeadm/control-plane/tasks/secondary.yml b/roles/kubernetes/kubeadm/control-plane/tasks/secondary.yml
index 242293ea..7c2f490f 100644
--- a/roles/kubernetes/kubeadm/control-plane/tasks/secondary.yml
+++ b/roles/kubernetes/kubeadm/control-plane/tasks/secondary.yml
@@ -15,16 +15,16 @@
kubernetes_current_nodes: "{{ kubectl_node_list.stdout_lines | map('replace', 'node/', '') | list }}"
- name: upload certs
- when: "groups['_kubernetes_controlplane_nodes_'] | difference(kubernetes_current_nodes) | length > 0"
+ when: "groups['_kubernetes_controlplane_nodes_'] | map('extract', hostvars, 'kubernetes_node_name') | difference(kubernetes_current_nodes) | length > 0"
command: kubeadm init phase upload-certs --upload-certs
check_mode: no
register: kubeadm_upload_certs
-
- name: extracting encryption key for certs
set_fact:
kubeadm_upload_certs_key: "{% if kubeadm_upload_certs.stdout is defined %}{{ kubeadm_upload_certs.stdout_lines | last }}{% endif %}"
+
- name: generate kubeadm.config
template:
src: kubeadm-join.config.j2