main.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ---
  2. - name: Set the Hostname
  3. ansible.builtin.hostname:
  4. name: "{{ inventory_hostname }}"
  5. - name: Fix cmdline.txt
  6. import_tasks: cmdline.yml
  7. - name: system.yml
  8. import_tasks: system.yml
  9. - name: k9s.yml
  10. import_tasks: k9s.yml
  11. - name: Flush handlers to Reboot if Required
  12. meta: flush_handlers
  13. #- name: CRI-O Installation
  14. # import_tasks: cri-o.yml
  15. #
  16. #- name: K8S Installation
  17. # import_tasks: k8s_install.yml
  18. #
  19. #- name: Install Client Config
  20. # import_tasks: k8s_kubeadm_client.yml
  21. ## At this point, k8s is there, but we need to determine if a cluster has been created. If it has, then
  22. ## the nodes will all have .kube/config under fdamstra, and be able to talk to the master, and ask if
  23. ## there is a node marked 'k8s1', which is the node we bootstrap. If there is, then we skip all the
  24. ## bootstrapping. If not, we:
  25. ## a) Run the bootstrap on that node.
  26. ## b) Do not run anything else whatsoever.
  27. #- name: Check for k8s1
  28. # become_user: fdamstra
  29. # shell: kubectl get nodes | grep -c 'k8s1' || true
  30. # register: k8s1_status
  31. # changed_when: false # Do not mark as 'changed'
  32. # tags: wip
  33. #
  34. #- name: Determine Whether Bootstrap is Needed/Desired
  35. # set_fact:
  36. # bootstrap_needed: "{{ True if ( k8s_newinstall==True and k8s1_status.stdout == '0' ) else False }}"
  37. # tags: wip
  38. #
  39. #- name: Bootstrapping
  40. # import_tasks: bootstrap.yml
  41. # when: bootstrap_needed == True and inventory_hostname == "k8s1"
  42. #
  43. #- name: Join the cluster
  44. # import_tasks: k8s_join.yml
  45. # when: inventory_hostname != "k8s1" and not bootstrap_needed
  46. #
  47. #- name: Post joining tasks
  48. # import_tasks: k8s_postjoin.yml
  49. # when: not bootstrap_needed