main.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. - name: pre-install-common
  2. include_role:
  3. name: pre-install-common
  4. when:
  5. - ansible_connection is defined
  6. - ansible_connection == "ssh"
  7. - name: pre-install-host
  8. include_role:
  9. name: pre-install-host
  10. when:
  11. - ansible_connection is defined
  12. - ansible_connection == "ssh"
  13. - name: TCP Configuration
  14. include_role:
  15. name: tcp
  16. when:
  17. k8s_node_as_oc_controller|default(false)|bool == true
  18. - name: construct k8s_controlplane_host
  19. set_fact:
  20. k8s_controlplane_host: "{{groups['primary_master_node'][0]}}"
  21. when:
  22. k8s_controlplane_host is not defined or k8s_controlplane_host|length == 0
  23. - name: Add controlplane host
  24. add_host:
  25. hostname: '{{ k8s_controlplane_host }}'
  26. ansible_host: '{{ k8s_controlplane_host }}'
  27. ansible_ssh_host: '{{ k8s_controlplane_host }}'
  28. ansible_user: '{{ ansible_user }}'
  29. ansible_ssh_user: '{{ ansible_user }}'
  30. ansible_port: '{{ k8s_controlplane_ssh_port | default(22) }}'
  31. ansible_ssh_port: '{{ k8s_controlplane_ssh_port | default(22) }}'
  32. - name: include some {{ k8s_or_k3s }} tasks
  33. include_tasks: "{{ k8s_or_k3s }}.yml"
  34. - name: Include worker-node/lbagent tasks
  35. include_role:
  36. name: worker-node/lbagent
  37. when:
  38. enable_lbagent