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.

127 lines
4.2 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
  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: not etcd_kubeadm_enabled| default(false)
  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: not etcd_kubeadm_enabled| default(false)
  56. - hosts: k8s_cluster
  57. gather_facts: False
  58. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  59. environment: "{{ proxy_disable_env }}"
  60. roles:
  61. - { role: kubespray-defaults }
  62. - { role: kubernetes/node, tags: node }
  63. - hosts: kube_control_plane
  64. gather_facts: False
  65. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  66. environment: "{{ proxy_disable_env }}"
  67. roles:
  68. - { role: kubespray-defaults }
  69. - { role: kubernetes/control-plane, tags: master }
  70. - { role: kubernetes/client, tags: client }
  71. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  72. - hosts: k8s_cluster
  73. gather_facts: False
  74. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  75. environment: "{{ proxy_disable_env }}"
  76. roles:
  77. - { role: kubespray-defaults }
  78. - { role: kubernetes/kubeadm, tags: kubeadm}
  79. - { role: kubernetes/node-label, tags: node-label }
  80. - { role: network_plugin, tags: network }
  81. - hosts: calico_rr
  82. gather_facts: False
  83. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  84. environment: "{{ proxy_disable_env }}"
  85. roles:
  86. - { role: kubespray-defaults }
  87. - { role: network_plugin/calico/rr, tags: ['network', 'calico_rr'] }
  88. - hosts: kube_control_plane[0]
  89. gather_facts: False
  90. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  91. environment: "{{ proxy_disable_env }}"
  92. roles:
  93. - { role: kubespray-defaults }
  94. - { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
  95. - hosts: kube_control_plane
  96. gather_facts: False
  97. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  98. environment: "{{ proxy_disable_env }}"
  99. roles:
  100. - { role: kubespray-defaults }
  101. - { role: kubernetes-apps/external_cloud_controller, tags: external-cloud-controller }
  102. - { role: kubernetes-apps/network_plugin, tags: network }
  103. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  104. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  105. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  106. - { role: kubernetes-apps, tags: apps }
  107. - hosts: k8s_cluster
  108. gather_facts: False
  109. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  110. environment: "{{ proxy_disable_env }}"
  111. roles:
  112. - { role: kubespray-defaults }
  113. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }