mirror of
https://github.com/geerlingguy/ansible-role-kubernetes.git
synced 2024-11-18 19:10:39 +01:00
Fixes #10: Set kubernetes_join_command more reliably.
This commit is contained in:
parent
b16f139a84
commit
0141762b92
@ -51,8 +51,15 @@
|
|||||||
shell: kubeadm token create --print-join-command
|
shell: kubeadm token create --print-join-command
|
||||||
changed_when: False
|
changed_when: False
|
||||||
when: kubernetes_role == 'master'
|
when: kubernetes_role == 'master'
|
||||||
run_once: True
|
register: kubernetes_join_command_result
|
||||||
register: kubernetes_join_command
|
|
||||||
|
- name: Set the kubeadm join command globally.
|
||||||
|
set_fact:
|
||||||
|
kubernetes_join_command: "{{ kubernetes_join_command_result.stdout }}"
|
||||||
|
when: kubernetes_join_command_result.stdout is defined
|
||||||
|
delegate_to: "{{ item }}"
|
||||||
|
delegate_facts: True
|
||||||
|
with_items: "{{ groups['all'] }}"
|
||||||
|
|
||||||
- include_tasks: node-setup.yml
|
- include_tasks: node-setup.yml
|
||||||
when: kubernetes_role == 'node'
|
when: kubernetes_role == 'node'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: Join node to Kubernetes master
|
- name: Join node to Kubernetes master
|
||||||
shell: >
|
shell: >
|
||||||
{{ kubernetes_join_command.stdout }}
|
{{ kubernetes_join_command }}
|
||||||
creates=/etc/kubernetes/kubelet.conf
|
creates=/etc/kubernetes/kubelet.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user