24 lines
712 B
YAML
24 lines
712 B
YAML
---
|
|
- hosts: worker-node
|
|
name: add the worker
|
|
|
|
tasks:
|
|
- name:
|
|
debug:
|
|
msg: "[Worker] K8S_TOKEN_HOLDER K8S token is {{ hostvars['K8S_TOKEN_HOLDER']['token'] }}"
|
|
|
|
- name:
|
|
debug:
|
|
msg: "[Worker] K8S_TOKEN_HOLDER K8S Hash is {{ hostvars['K8S_TOKEN_HOLDER']['hash'] }}"
|
|
|
|
- name:
|
|
debug:
|
|
msg: "[Worker] K8S_TOKEN_HOLDER K8S IP and Port is {{ hostvars['K8S_TOKEN_HOLDER']['ipport'] }}"
|
|
|
|
- name: "Kubeadm join"
|
|
become: yes
|
|
shell: >
|
|
kubeadm join --token={{ hostvars['K8S_TOKEN_HOLDER']['token'] }}
|
|
--discovery-token-ca-cert-hash sha256:{{ hostvars['K8S_TOKEN_HOLDER']['hash'] }}
|
|
{{ hostvars['K8S_TOKEN_HOLDER']['ipport'] }}
|