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.

104 lines
3.6 KiB

9 years ago
9 years ago
9 years ago
  1. ---
  2. - hosts: localhost
  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. - hosts: k8s-cluster:etcd:calico-rr
  23. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  24. roles:
  25. - { role: kubespray-defaults}
  26. - { role: kubernetes/preinstall, tags: preinstall }
  27. - { role: docker, tags: docker }
  28. - role: rkt
  29. tags: rkt
  30. when: "'rkt' in [etcd_deployment_type, kubelet_deployment_type, vault_deployment_type]"
  31. - hosts: etcd:k8s-cluster:vault
  32. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  33. roles:
  34. - { role: kubespray-defaults, when: "cert_management == 'vault'" }
  35. - { role: vault, tags: vault, vault_bootstrap: true, when: "cert_management == 'vault'" }
  36. - hosts: etcd
  37. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  38. roles:
  39. - { role: kubespray-defaults}
  40. - { role: etcd, tags: etcd, etcd_cluster_setup: true }
  41. - hosts: k8s-cluster
  42. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  43. roles:
  44. - { role: kubespray-defaults}
  45. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  46. - hosts: etcd:k8s-cluster:vault
  47. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  48. roles:
  49. - { role: kubespray-defaults}
  50. - { role: vault, tags: vault, when: "cert_management == 'vault'"}
  51. - hosts: k8s-cluster
  52. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  53. roles:
  54. - { role: kubespray-defaults}
  55. - { role: kubernetes/node, tags: node }
  56. - hosts: kube-master
  57. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  58. roles:
  59. - { role: kubespray-defaults}
  60. - { role: kubernetes/master, tags: master }
  61. - hosts: k8s-cluster
  62. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  63. roles:
  64. - { role: kubespray-defaults}
  65. - { role: kubernetes/kubeadm, tags: kubeadm, when: "kubeadm_enabled" }
  66. - { role: network_plugin, tags: network }
  67. - hosts: kube-master
  68. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  69. roles:
  70. - { role: kubespray-defaults}
  71. - { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
  72. - { role: kubernetes-apps/network_plugin, tags: network }
  73. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  74. - { role: kubernetes/client, tags: client }
  75. - hosts: calico-rr
  76. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  77. roles:
  78. - { role: kubespray-defaults}
  79. - { role: network_plugin/calico/rr, tags: network }
  80. - hosts: k8s-cluster
  81. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  82. roles:
  83. - { role: kubespray-defaults}
  84. - { role: dnsmasq, when: "dns_mode == 'dnsmasq_kubedns'", tags: dnsmasq }
  85. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf }
  86. - hosts: kube-master[0]
  87. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  88. roles:
  89. - { role: kubespray-defaults}
  90. - { role: kubernetes-apps, tags: apps }