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.

135 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. - hosts: all
  5. gather_facts: false
  6. tasks:
  7. - name: "Set up proxy environment"
  8. set_fact:
  9. proxy_env:
  10. http_proxy: "{{ http_proxy | default ('') }}"
  11. HTTP_PROXY: "{{ http_proxy | default ('') }}"
  12. https_proxy: "{{ https_proxy | default ('') }}"
  13. HTTPS_PROXY: "{{ https_proxy | default ('') }}"
  14. no_proxy: "{{ no_proxy | default ('') }}"
  15. NO_PROXY: "{{ no_proxy | default ('') }}"
  16. no_log: true
  17. - hosts: bastion[0]
  18. gather_facts: False
  19. roles:
  20. - { role: kubespray-defaults }
  21. - { role: bastion-ssh-config, tags: ["localhost", "bastion"] }
  22. - hosts: k8s-cluster:etcd
  23. strategy: linear
  24. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  25. gather_facts: false
  26. roles:
  27. - { role: kubespray-defaults }
  28. - { role: bootstrap-os, tags: bootstrap-os}
  29. - name: Gather facts
  30. import_playbook: facts.yml
  31. - hosts: k8s-cluster:etcd
  32. gather_facts: False
  33. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  34. roles:
  35. - { role: kubespray-defaults }
  36. - { role: kubernetes/preinstall, tags: preinstall }
  37. - { role: "container-engine", tags: "container-engine", when: deploy_container_engine|default(true) }
  38. - { role: download, tags: download, when: "not skip_downloads" }
  39. environment: "{{ proxy_env }}"
  40. - hosts: etcd
  41. gather_facts: False
  42. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  43. roles:
  44. - { role: kubespray-defaults }
  45. - role: etcd
  46. tags: etcd
  47. vars:
  48. etcd_cluster_setup: true
  49. etcd_events_cluster_setup: "{{ etcd_events_cluster_enabled }}"
  50. when: not etcd_kubeadm_enabled| default(false)
  51. - hosts: k8s-cluster
  52. gather_facts: False
  53. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  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. roles:
  66. - { role: kubespray-defaults }
  67. - { role: kubernetes/node, tags: node }
  68. environment: "{{ proxy_env }}"
  69. - hosts: kube-master
  70. gather_facts: False
  71. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  72. roles:
  73. - { role: kubespray-defaults }
  74. - { role: kubernetes/master, tags: master }
  75. - { role: kubernetes/client, tags: client }
  76. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  77. - hosts: k8s-cluster
  78. gather_facts: False
  79. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  80. roles:
  81. - { role: kubespray-defaults }
  82. - { role: kubernetes/kubeadm, tags: kubeadm}
  83. - { role: network_plugin, tags: network }
  84. - { role: kubernetes/node-label, tags: node-label }
  85. - hosts: calico-rr
  86. gather_facts: False
  87. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  88. roles:
  89. - { role: kubespray-defaults }
  90. - { role: network_plugin/calico/rr, tags: ['network', 'calico_rr'] }
  91. - hosts: kube-master[0]
  92. gather_facts: False
  93. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  94. roles:
  95. - { role: kubespray-defaults }
  96. - { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
  97. - { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
  98. - hosts: kube-master
  99. gather_facts: False
  100. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  101. roles:
  102. - { role: kubespray-defaults }
  103. - { role: kubernetes-apps/external_cloud_controller, tags: external-cloud-controller }
  104. - { role: kubernetes-apps/network_plugin, tags: network }
  105. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  106. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  107. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  108. - hosts: kube-master
  109. gather_facts: False
  110. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  111. roles:
  112. - { role: kubespray-defaults }
  113. - { role: kubernetes-apps, tags: apps }
  114. environment: "{{ proxy_env }}"
  115. - hosts: k8s-cluster
  116. gather_facts: False
  117. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  118. roles:
  119. - { role: kubespray-defaults }
  120. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }