---

- name: Turn Swap OFF (if not already disabled)
  command: /usr/sbin/swapoff -a
  tags: init

#- name:
  #debug:
    #msg: "[Worker] K8S_TOKEN_HOLDER K8S token is {{ hostvars['K8S_TOKEN_HOLDER']['token'] }}"
  #tags: init

#- name:
  #debug:
    #msg: "[Worker] K8S_TOKEN_HOLDER K8S Hash is  {{ hostvars['K8S_TOKEN_HOLDER']['hash'] }}"
  #tags: init

#- name:
  #debug:
    #msg: "[Worker] K8S_MASTER_IP is  {{ hostvars['K8S_TOKEN_HOLDER']['ip'] }}"
  #tags: init

- name: "Kubeadmn join"
  shell: >
    kubeadm join --token={{ hostvars['K8S_TOKEN_HOLDER']['token'] }}
    --discovery-token-ca-cert-hash sha256:{{ hostvars['K8S_TOKEN_HOLDER']['hash'] }}
    {{ hostvars['K8S_TOKEN_HOLDER']['ip'] }}:6443
  tags: init


#- name: Join Computes to pool
#   command: "{{ kubeJoinCommand }}"
# tags: init

