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.

122 lines
4.5 KiB

9 years ago
9 years ago
9 years ago
  1. ---
  2. - hosts: bastion[0]
  3. gather_facts: False
  4. roles:
  5. - { role: kubespray-defaults}
  6. - { role: bastion-ssh-config, tags: ["localhost", "bastion"]}
  7. - hosts: k8s-cluster:etcd:calico-rr
  8. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  9. gather_facts: false
  10. vars:
  11. # Need to disable pipelining for bootstrap-os as some systems have requiretty in sudoers set, which makes pipelining
  12. # fail. bootstrap-os fixes this on these systems, so in later plays it can be enabled.
  13. ansible_ssh_pipelining: false
  14. roles:
  15. - { role: kubespray-defaults}
  16. - { role: bootstrap-os, tags: bootstrap-os}
  17. - hosts: k8s-cluster:etcd:calico-rr
  18. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  19. vars:
  20. ansible_ssh_pipelining: true
  21. gather_facts: true
  22. pre_tasks:
  23. - name: gather facts from all instances
  24. setup:
  25. delegate_to: "{{item}}"
  26. delegate_facts: True
  27. with_items: "{{ groups['k8s-cluster'] + groups['etcd'] + groups['calico-rr']|default([]) }}"
  28. - hosts: k8s-cluster:etcd:calico-rr
  29. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  30. roles:
  31. - { role: kubespray-defaults}
  32. - { role: kubernetes/preinstall, tags: preinstall }
  33. - { role: "container-engine", tags: "container-engine" }
  34. - { role: download, tags: download, when: "not skip_downloads" }
  35. environment: "{{proxy_env}}"
  36. - hosts: etcd:k8s-cluster:vault:calico-rr
  37. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  38. roles:
  39. - { role: kubespray-defaults, when: "cert_management == 'vault'" }
  40. - { role: vault, tags: vault, vault_bootstrap: true, when: "cert_management == 'vault'" }
  41. environment: "{{proxy_env}}"
  42. - hosts: etcd
  43. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  44. roles:
  45. - { role: kubespray-defaults}
  46. - { role: etcd, tags: etcd, etcd_cluster_setup: true, etcd_events_cluster_setup: "{{ etcd_events_cluster_enabled }}" }
  47. - hosts: k8s-cluster:calico-rr
  48. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  49. roles:
  50. - { role: kubespray-defaults}
  51. - { role: etcd, tags: etcd, etcd_cluster_setup: false, etcd_events_cluster_setup: false }
  52. - hosts: etcd:k8s-cluster:vault:calico-rr
  53. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  54. roles:
  55. - { role: kubespray-defaults}
  56. - { role: vault, tags: vault, when: "cert_management == 'vault'"}
  57. environment: "{{proxy_env}}"
  58. - hosts: k8s-cluster
  59. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  60. roles:
  61. - { role: kubespray-defaults}
  62. - { role: kubernetes/node, tags: node }
  63. environment: "{{proxy_env}}"
  64. - hosts: kube-master
  65. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  66. roles:
  67. - { role: kubespray-defaults}
  68. - { role: kubernetes/master, tags: master }
  69. - { role: kubernetes/client, tags: client }
  70. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  71. - hosts: k8s-cluster
  72. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  73. roles:
  74. - { role: kubespray-defaults}
  75. - { role: kubernetes/kubeadm, tags: kubeadm, when: "kubeadm_enabled" }
  76. - { role: network_plugin, tags: network }
  77. - hosts: kube-master[0]
  78. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  79. roles:
  80. - { role: kubespray-defaults}
  81. - { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
  82. - { role: win_nodes/kubernetes_patch, tags: win_nodes, when: "kubeadm_enabled" }
  83. - hosts: kube-master
  84. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  85. roles:
  86. - { role: kubespray-defaults}
  87. - { role: kubernetes-apps/network_plugin, tags: network }
  88. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  89. - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
  90. - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
  91. - hosts: calico-rr
  92. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  93. roles:
  94. - { role: kubespray-defaults}
  95. - { role: network_plugin/calico/rr, tags: network }
  96. - hosts: k8s-cluster
  97. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  98. roles:
  99. - { role: kubespray-defaults}
  100. - { role: dnsmasq, when: "dns_mode == 'dnsmasq_kubedns'", tags: dnsmasq }
  101. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf }
  102. environment: "{{proxy_env}}"
  103. - hosts: kube-master
  104. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  105. roles:
  106. - { role: kubespray-defaults}
  107. - { role: kubernetes-apps, tags: apps }