You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
4.3 KiB

  1. ---
  2. - name: Check ansible version
  3. import_playbook: ansible_version.yml
  4. - name: Ensure compatibility with old groups
  5. import_playbook: legacy_groups.yml
  6. - hosts: bastion[0]
  7. gather_facts: False
  8. environment: "{{ proxy_disable_env }}"
  9. roles:
  10. - { role: kubespray-defaults }
  11. - { role: bastion-ssh-config, tags: ["localhost", "bastion"] }
  12. - name: Gather facts
  13. tags: always
  14. import_playbook: facts.yml
  15. - hosts: k8s_cluster:etcd
  16. gather_facts: False
  17. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  18. environment: "{{ proxy_disable_env }}"
  19. roles:
  20. - { role: kubespray-defaults }
  21. - { role: kubernetes/preinstall, tags: preinstall }
  22. - { role: "container-engine", tags: "container-engine", when: deploy_container_engine }
  23. - { role: download, tags: download, when: "not skip_downloads" }
  24. - hosts: etcd:kube_control_plane
  25. gather_facts: False
  26. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  27. environment: "{{ proxy_disable_env }}"
  28. roles:
  29. - { role: kubespray-defaults }
  30. - role: etcd
  31. tags: etcd
  32. vars:
  33. etcd_cluster_setup: true
  34. etcd_events_cluster_setup: "{{ etcd_events_cluster_enabled }}"
  35. when: etcd_deployment_type != "kubeadm"
  36. - hosts: k8s_cluster
  37. gather_facts: False
  38. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  39. environment: "{{ proxy_disable_env }}"
  40. roles:
  41. - { role: kubespray-defaults }
  42. - role: etcd
  43. tags: etcd
  44. vars:
  45. etcd_cluster_setup: false
  46. etcd_events_cluster_setup: false
  47. when:
  48. - etcd_deployment_type != "kubeadm"
  49. - kube_network_plugin in ["calico", "flannel", "canal", "cilium"] or cilium_deploy_additionally | default(false) | bool
  50. - kube_network_plugin != "calico" or calico_datastore == "etcd"
  51. - hosts: k8s_cluster
  52. gather_facts: False
  53. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  54. environment: "{{ proxy_disable_env }}"
  55. roles:
  56. - { role: kubespray-defaults }
  57. - { role: kubernetes/node, tags: node }
  58. - hosts: kube_control_plane
  59. gather_facts: False
  60. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  61. environment: "{{ proxy_disable_env }}"
  62. roles:
  63. - { role: kubespray-defaults }
  64. - { role: kubernetes/control-plane, tags: master }
  65. - { role: kubernetes/client, tags: client }
  66. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  67. - hosts: k8s_cluster
  68. gather_facts: False
  69. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  70. environment: "{{ proxy_disable_env }}"
  71. roles:
  72. - { role: kubespray-defaults }
  73. - { role: kubernetes/kubeadm, tags: kubeadm}
  74. - { role: kubernetes/node-label, tags: node-label }
  75. - { role: network_plugin, tags: network }
  76. - { role: kubernetes-apps/kubelet-csr-approver, tags: kubelet-csr-approver }
  77. - hosts: calico_rr
  78. gather_facts: False
  79. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  80. environment: "{{ proxy_disable_env }}"
  81. roles:
  82. - { role: kubespray-defaults }
  83. - { role: network_plugin/calico/rr, tags: ['network', 'calico_rr'] }
  84. - hosts: kube_control_plane[0]
  85. gather_facts: False
  86. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  87. environment: "{{ proxy_disable_env }}"
  88. roles:
  89. - { role: kubespray-defaults }
  90. - { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
  91. - hosts: kube_control_plane
  92. gather_facts: False
  93. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  94. environment: "{{ proxy_disable_env }}"
  95. roles:
  96. - { role: kubespray-defaults }
  97. - { role: kubernetes-apps/external_cloud_controller, tags: external-cloud-controller }
  98. - { role: kubernetes-apps/network_plugin, tags: network }
  99. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  100. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  101. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  102. - { role: kubernetes-apps, tags: apps }
  103. - name: Apply resolv.conf changes now that cluster DNS is up
  104. hosts: k8s_cluster
  105. gather_facts: False
  106. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  107. environment: "{{ proxy_disable_env }}"
  108. roles:
  109. - { role: kubespray-defaults }
  110. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }