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
4.0 KiB

9 years ago
8 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. - { role: download, tags: download, skip_downloads: false }
  32. environment: "{{proxy_env}}"
  33. - hosts: etcd:k8s-cluster:vault:calico-rr
  34. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  35. roles:
  36. - { role: kubespray-defaults, when: "cert_management == 'vault'" }
  37. - { role: vault, tags: vault, vault_bootstrap: true, when: "cert_management == 'vault'" }
  38. environment: "{{proxy_env}}"
  39. - hosts: etcd
  40. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  41. roles:
  42. - { role: kubespray-defaults}
  43. - { role: etcd, tags: etcd, etcd_cluster_setup: true }
  44. - hosts: k8s-cluster:calico-rr
  45. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  46. roles:
  47. - { role: kubespray-defaults}
  48. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  49. - hosts: etcd:k8s-cluster:vault:calico-rr
  50. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  51. roles:
  52. - { role: kubespray-defaults}
  53. - { role: vault, tags: vault, when: "cert_management == 'vault'"}
  54. environment: "{{proxy_env}}"
  55. - hosts: k8s-cluster
  56. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  57. roles:
  58. - { role: kubespray-defaults}
  59. - { role: kubernetes/node, tags: node }
  60. environment: "{{proxy_env}}"
  61. - hosts: kube-master
  62. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  63. roles:
  64. - { role: kubespray-defaults}
  65. - { role: kubernetes/master, tags: master }
  66. - { role: kubernetes/client, tags: client }
  67. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  68. - hosts: k8s-cluster
  69. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  70. roles:
  71. - { role: kubespray-defaults}
  72. - { role: kubernetes/kubeadm, tags: kubeadm, when: "kubeadm_enabled" }
  73. - { role: network_plugin, tags: network }
  74. - hosts: kube-master[0]
  75. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  76. roles:
  77. - { role: kubespray-defaults}
  78. - { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
  79. - hosts: kube-master
  80. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  81. roles:
  82. - { role: kubespray-defaults}
  83. - { role: kubernetes-apps/network_plugin, tags: network }
  84. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  85. - hosts: calico-rr
  86. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  87. roles:
  88. - { role: kubespray-defaults}
  89. - { role: network_plugin/calico/rr, tags: network }
  90. - hosts: k8s-cluster
  91. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  92. roles:
  93. - { role: kubespray-defaults}
  94. - { role: dnsmasq, when: "dns_mode == 'dnsmasq_kubedns'", tags: dnsmasq }
  95. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf }
  96. environment: "{{proxy_env}}"
  97. - hosts: kube-master[0]
  98. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  99. roles:
  100. - { role: kubespray-defaults}
  101. - { role: kubernetes-apps, tags: apps }