main.yml 907 B

1234567891011121314151617181920212223242526272829
  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: TCP Configuration
  8. include_role:
  9. name: tcp
  10. - name: construct k8s_controlplane_host
  11. set_fact:
  12. k8s_controlplane_host: "{{groups['primary_master_node'][0]}}"
  13. when:
  14. k8s_controlplane_host is not defined or k8s_controlplane_host|length == 0
  15. - name: Add controlplane host
  16. add_host:
  17. hostname: '{{ k8s_controlplane_host }}'
  18. ansible_host: '{{ k8s_controlplane_host }}'
  19. ansible_ssh_host: '{{ k8s_controlplane_host }}'
  20. ansible_user: '{{ ansible_user }}'
  21. ansible_ssh_user: '{{ ansible_user }}'
  22. ansible_port: '{{ k8s_controlplane_ssh_port | default(22) }}'
  23. ansible_ssh_port: '{{ k8s_controlplane_ssh_port | default(22) }}'
  24. - name: Include {{ k8s_or_k3s }} Master node job
  25. include_tasks: "{{ k8s_or_k3s }}.yml"