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.

116 lines
3.7 KiB

9 years ago
8 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. - { role: kubernetes/node-label }
  74. - hosts: calico-rr
  75. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  76. roles:
  77. - { role: kubespray-defaults}
  78. - { role: network_plugin/calico/rr, tags: ['network', 'calico_rr']}
  79. - hosts: kube-master[0]
  80. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  81. roles:
  82. - { role: kubespray-defaults}
  83. - { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
  84. - { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"]}
  85. - hosts: kube-master
  86. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  87. roles:
  88. - { role: kubespray-defaults}
  89. - { role: kubernetes-apps/network_plugin, tags: network }
  90. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  91. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  92. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  93. - hosts: kube-master
  94. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  95. roles:
  96. - { role: kubespray-defaults}
  97. - { role: kubernetes-apps, tags: apps }
  98. environment: "{{ proxy_env }}"
  99. - hosts: k8s-cluster
  100. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  101. roles:
  102. - { role: kubespray-defaults}
  103. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }