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.

118 lines
4.1 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. - { role: download, tags: download, skip_downloads: false }
  32. environment: "{{proxy_env}}"
  33. - hosts: etcd:k8s-cluster:vault
  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. environment: "{{proxy_env}}"
  45. - hosts: k8s-cluster
  46. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  47. roles:
  48. - { role: kubespray-defaults}
  49. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  50. environment: "{{proxy_env}}"
  51. - hosts: etcd:k8s-cluster:vault
  52. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  53. roles:
  54. - { role: kubespray-defaults}
  55. - { role: vault, tags: vault, when: "cert_management == 'vault'"}
  56. environment: "{{proxy_env}}"
  57. - hosts: k8s-cluster
  58. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  59. roles:
  60. - { role: kubespray-defaults}
  61. - { role: kubernetes/node, tags: node }
  62. environment: "{{proxy_env}}"
  63. - hosts: kube-master
  64. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  65. roles:
  66. - { role: kubespray-defaults}
  67. - { role: kubernetes/master, tags: master }
  68. - { role: kubernetes/client, tags: client }
  69. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  70. environment: "{{proxy_env}}"
  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. environment: "{{proxy_env}}"
  78. - hosts: kube-master
  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: kubernetes-apps/network_plugin, tags: network }
  84. - { role: kubernetes-apps/policy_controller, tags: policy-controller }
  85. environment: "{{proxy_env}}"
  86. - hosts: calico-rr
  87. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  88. roles:
  89. - { role: kubespray-defaults}
  90. - { role: network_plugin/calico/rr, tags: network }
  91. environment: "{{proxy_env}}"
  92. - hosts: k8s-cluster
  93. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  94. roles:
  95. - { role: kubespray-defaults}
  96. - { role: dnsmasq, when: "dns_mode == 'dnsmasq_kubedns'", tags: dnsmasq }
  97. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf }
  98. environment: "{{proxy_env}}"
  99. - hosts: kube-master[0]
  100. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  101. roles:
  102. - { role: kubespray-defaults}
  103. - { role: kubernetes-apps, tags: apps }
  104. environment: "{{proxy_env}}"