Skip to content

Commit

Permalink
Changed to use first_kube_control_plane to parse kubeadm_certificate_key
Browse files Browse the repository at this point in the history
Co-Authored-By: nvalembois <[email protected]>
  • Loading branch information
Xartos and nvalembois committed Jan 10, 2025
1 parent b854196 commit daad54a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions roles/kubernetes/control-plane/tasks/kubeadm-secondary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

- name: Parse certificate key if not set
set_fact:
kubeadm_certificate_key: "{{ hostvars[groups['kube_control_plane'][0]]['kubeadm_upload_cert'].stdout_lines[-1] | trim }}"
kubeadm_certificate_key: "{{ hostvars[first_kube_control_plane]['kubeadm_upload_cert'].stdout_lines[-1] | trim }}"
run_once: true
when:
- hostvars[groups['kube_control_plane'][0]]['kubeadm_upload_cert'] is defined
- hostvars[groups['kube_control_plane'][0]]['kubeadm_upload_cert'] is not skipped
- hostvars[first_kube_control_plane]['kubeadm_upload_cert'] is defined
- hostvars[first_kube_control_plane]['kubeadm_upload_cert'] is not skipped

- name: Create kubeadm ControlPlane config
template:
Expand Down

0 comments on commit daad54a

Please sign in to comment.