mirror of
https://github.com/geerlingguy/ansible-role-kubernetes.git
synced 2024-12-21 19:06:56 +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
|
||||
changed_when: False
|
||||
when: kubernetes_role == 'master'
|
||||
run_once: True
|
||||
register: kubernetes_join_command
|
||||
register: kubernetes_join_command_result
|
||||
|
||||
- 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
|
||||
when: kubernetes_role == 'node'
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Join node to Kubernetes master
|
||||
shell: >
|
||||
{{ kubernetes_join_command.stdout }}
|
||||
{{ kubernetes_join_command }}
|
||||
creates=/etc/kubernetes/kubelet.conf
|
||||
|
Loading…
Reference in New Issue
Block a user