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.

115 lines
3.7 KiB

9 years ago
9 years ago
9 years ago
  1. ---
  2. - hosts: localhost
  3. gather_facts: false
  4. become: no
  5. tasks:
  6. - name: "Check ansible version >=2.7.8"
  7. assert:
  8. msg: "Ansible must be v2.7.8 or higher"
  9. that:
  10. - ansible_version.string is version("2.7.8", ">=")
  11. tags:
  12. - check
  13. vars:
  14. ansible_connection: local
  15. - hosts: bastion[0]
  16. gather_facts: False
  17. roles:
  18. - { role: kubespray-defaults}
  19. - { role: bastion-ssh-config, tags: ["localhost", "bastion"]}
  20. - hosts: k8s-cluster:etcd
  21. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  22. gather_facts: false
  23. roles:
  24. - { role: kubespray-defaults}
  25. - { role: bootstrap-os, tags: bootstrap-os}
  26. - hosts: k8s-cluster:etcd
  27. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  28. roles:
  29. - { role: kubespray-defaults}
  30. - { role: kubernetes/preinstall, tags: preinstall }
  31. - { role: "container-engine", tags: "container-engine", when: deploy_container_engine|default(true) }
  32. - { role: download, tags: download, when: "not skip_downloads" }
  33. environment: "{{ proxy_env }}"
  34. - hosts: etcd
  35. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  36. roles:
  37. - { role: kubespray-defaults}
  38. - role: etcd
  39. tags: etcd
  40. vars:
  41. etcd_cluster_setup: true
  42. etcd_events_cluster_setup: "{{ etcd_events_cluster_enabled }}"
  43. when: not etcd_kubeadm_enabled| default(false)
  44. - hosts: k8s-cluster
  45. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  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. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  56. roles:
  57. - { role: kubespray-defaults}
  58. - { role: kubernetes/node, tags: node }
  59. environment: "{{ proxy_env }}"
  60. - hosts: kube-master
  61. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  62. roles:
  63. - { role: kubespray-defaults}
  64. - { role: kubernetes/master, tags: master }
  65. - { role: kubernetes/client, tags: client }
  66. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  67. - hosts: k8s-cluster
  68. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  69. roles:
  70. - { role: kubespray-defaults}
  71. - { role: kubernetes/kubeadm, tags: kubeadm}
  72. - { role: network_plugin, tags: network }
  73. - hosts: calico-rr
  74. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  75. roles:
  76. - { role: kubespray-defaults}
  77. - { role: network_plugin/calico/rr, tags: ['network', 'calico_rr']}
  78. - hosts: kube-master[0]
  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. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  86. roles:
  87. - { role: kubespray-defaults}
  88. - { role: kubernetes-apps/network_plugin, tags: network }
  89. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  90. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  91. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  92. - hosts: kube-master
  93. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  94. roles:
  95. - { role: kubespray-defaults}
  96. - { role: kubernetes-apps, tags: apps }
  97. environment: "{{ proxy_env }}"
  98. - hosts: k8s-cluster
  99. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  100. roles:
  101. - { role: kubespray-defaults}
  102. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }