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.

140 lines
4.6 KiB

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