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.

124 lines
4.5 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. 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: docker, tags: docker, when: manage_docker|default(true) }
  34. - role: rkt
  35. tags: rkt
  36. when: "'rkt' in [etcd_deployment_type, kubelet_deployment_type, vault_deployment_type]"
  37. - { role: download, tags: download, when: "not skip_downloads" }
  38. environment: "{{proxy_env}}"
  39. - hosts: etcd:k8s-cluster:vault:calico-rr
  40. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  41. roles:
  42. - { role: kubespray-defaults, when: "cert_management == 'vault'" }
  43. - { role: vault, tags: vault, vault_bootstrap: true, when: "cert_management == 'vault'" }
  44. environment: "{{proxy_env}}"
  45. - hosts: etcd
  46. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  47. roles:
  48. - { role: kubespray-defaults}
  49. - { role: etcd, tags: etcd, etcd_cluster_setup: true, etcd_events_cluster_setup: "{{ etcd_events_cluster_enabled }}" }
  50. - hosts: k8s-cluster:calico-rr
  51. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  52. roles:
  53. - { role: kubespray-defaults}
  54. - { role: etcd, tags: etcd, etcd_cluster_setup: false, etcd_events_cluster_setup: false }
  55. - hosts: etcd:k8s-cluster:vault:calico-rr
  56. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  57. roles:
  58. - { role: kubespray-defaults}
  59. - { role: vault, tags: vault, when: "cert_management == 'vault'"}
  60. environment: "{{proxy_env}}"
  61. - hosts: k8s-cluster
  62. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  63. roles:
  64. - { role: kubespray-defaults}
  65. - { role: kubernetes/node, tags: node }
  66. environment: "{{proxy_env}}"
  67. - hosts: kube-master
  68. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  69. roles:
  70. - { role: kubespray-defaults}
  71. - { role: kubernetes/master, tags: master }
  72. - { role: kubernetes/client, tags: client }
  73. - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
  74. - hosts: k8s-cluster
  75. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  76. roles:
  77. - { role: kubespray-defaults}
  78. - { role: kubernetes/kubeadm, tags: kubeadm, when: "kubeadm_enabled" }
  79. - { role: network_plugin, tags: network }
  80. - hosts: kube-master[0]
  81. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  82. roles:
  83. - { role: kubespray-defaults}
  84. - { role: kubernetes-apps/rotate_tokens, tags: rotate_tokens, when: "secret_changed|default(false)" }
  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: calico-rr
  94. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  95. roles:
  96. - { role: kubespray-defaults}
  97. - { role: network_plugin/calico/rr, tags: network }
  98. - hosts: k8s-cluster
  99. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  100. roles:
  101. - { role: kubespray-defaults}
  102. - { role: dnsmasq, when: "dns_mode == 'dnsmasq_kubedns'", tags: dnsmasq }
  103. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf }
  104. environment: "{{proxy_env}}"
  105. - hosts: kube-master[0]
  106. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  107. roles:
  108. - { role: kubespray-defaults}
  109. - { role: kubernetes-apps, tags: apps }