initial commit
This commit is contained in:
21
ansible/playbooks/06-worker-join.yml
Normal file
21
ansible/playbooks/06-worker-join.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: Join workers to Kubernetes cluster
|
||||
hosts: workers
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: Check if already joined
|
||||
stat:
|
||||
path: /etc/kubernetes/kubelet.conf
|
||||
register: kubelet_conf
|
||||
|
||||
- name: Read join command from local file
|
||||
local_action:
|
||||
module: slurp
|
||||
src: /tmp/k8s_join_command.sh
|
||||
register: join_command_b64
|
||||
when: not kubelet_conf.stat.exists
|
||||
|
||||
- name: Join cluster
|
||||
command: "{{ join_command_b64.content | b64decode | trim }}"
|
||||
when: not kubelet_conf.stat.exists
|
||||
Reference in New Issue
Block a user