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.

131 lines
4.4 KiB

9 years ago
9 years ago
9 years ago
  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. - hosts: k8s_cluster:etcd
  13. strategy: linear
  14. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  15. gather_facts: false
  16. environment: "{{ proxy_disable_env }}"
  17. roles:
  18. - { role: kubespray-defaults }
  19. - { role: bootstrap-os, tags: bootstrap-os}
  20. - name: Gather facts
  21. tags: always
  22. import_playbook: facts.yml
  23. - hosts: k8s_cluster:etcd
  24. gather_facts: False
  25. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  26. environment: "{{ proxy_disable_env }}"
  27. roles:
  28. - { role: kubespray-defaults }
  29. - { role: kubernetes/preinstall, tags: preinstall }
  30. - { role: "container-engine", tags: "container-engine", when: deploy_container_engine }
  31. - { role: download, tags: download, when: "not skip_downloads" }
  32. - hosts: etcd:kube_control_plane
  33. gather_facts: False
  34. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  35. environment: "{{ proxy_disable_env }}"
  36. roles:
  37. - { role: kubespray-defaults }
  38. - role: etcd
  39. tags: etcd
  40. vars:
  41. etcd_cluster_setup: true
  42. etcd_events_cluster_setup: "{{ etcd_events_cluster_enabled }}"
  43. when: etcd_deployment_type != "kubeadm"
  44. - hosts: k8s_cluster
  45. gather_facts: False
  46. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  47. environment: "{{ proxy_disable_env }}"
  48. roles:
  49. - { role: kubespray-defaults }
  50. - role: etcd
  51. tags: etcd
  52. vars:
  53. etcd_cluster_setup: false
  54. etcd_events_cluster_setup: false
  55. when:
  56. - etcd_deployment_type != "kubeadm"
  57. - kube_network_plugin in ["calico", "flannel", "canal", "cilium"] or cilium_deploy_additionally | default(false) | bool
  58. - kube_network_plugin != "calico" or calico_datastore == "etcd"
  59. - hosts: k8s_cluster
  60. gather_facts: False
  61. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  62. environment: "{{ proxy_disable_env }}"
  63. roles:
  64. - { role: kubespray-defaults }
  65. - { role: kubernetes/node, tags: node }
  66. - hosts: kube_control_plane
  67. gather_facts: False
  68. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  69. environment: "{{ proxy_disable_env }}"
  70. roles:
  71. - { role: kubespray-defaults }
  72. - { role: kubernetes/control-plane, tags: master }
  73. - { role: kubernetes/client, tags: client }
  74. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  75. - hosts: k8s_cluster
  76. gather_facts: False
  77. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  78. environment: "{{ proxy_disable_env }}"
  79. roles:
  80. - { role: kubespray-defaults }
  81. - { role: kubernetes/kubeadm, tags: kubeadm}
  82. - { role: kubernetes/node-label, tags: node-label }
  83. - { role: network_plugin, tags: network }
  84. - hosts: calico_rr
  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: network_plugin/calico/rr, tags: ['network', 'calico_rr'] }
  91. - hosts: kube_control_plane[0]
  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: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
  98. - hosts: kube_control_plane
  99. gather_facts: False
  100. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  101. environment: "{{ proxy_disable_env }}"
  102. roles:
  103. - { role: kubespray-defaults }
  104. - { role: kubernetes-apps/external_cloud_controller, tags: external-cloud-controller }
  105. - { role: kubernetes-apps/network_plugin, tags: network }
  106. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  107. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  108. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  109. - { role: kubernetes-apps, tags: apps }
  110. - name: Apply resolv.conf changes now that cluster DNS is up
  111. hosts: k8s_cluster
  112. gather_facts: False
  113. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  114. environment: "{{ proxy_disable_env }}"
  115. roles:
  116. - { role: kubespray-defaults }
  117. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }