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.

119 lines
3.9 KiB

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