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.

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