main.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Turn Swap OFF (if not already disabled)
  16. command: /usr/sbin/swapoff -a
  17. tags: init
  18. #- name:
  19. #debug:
  20. #msg: "[Worker] K8S_TOKEN_HOLDER K8S token is {{ hostvars['K8S_TOKEN_HOLDER']['token'] }}"
  21. #tags: init
  22. #- name:
  23. #debug:
  24. #msg: "[Worker] K8S_TOKEN_HOLDER K8S Hash is {{ hostvars['K8S_TOKEN_HOLDER']['hash'] }}"
  25. #tags: init
  26. #- name:
  27. #debug:
  28. #msg: "[Worker] K8S_MASTER_IP is {{ hostvars['K8S_TOKEN_HOLDER']['ip'] }}"
  29. #tags: init
  30. - name: "Kubeadmn join"
  31. shell: >
  32. kubeadm join --token={{ hostvars['K8S_TOKEN_HOLDER']['token'] }}
  33. --discovery-token-ca-cert-hash sha256:{{ hostvars['K8S_TOKEN_HOLDER']['hash'] }}
  34. {{ hostvars['K8S_TOKEN_HOLDER']['ip'] }}:6443
  35. when: not single_node
  36. tags: init
  37. #- name: Join Computes to pool
  38. # command: "{{ kubeJoinCommand }}"
  39. # tags: init