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.

132 lines
4.4 KiB

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