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.

92 lines
2.7 KiB

  1. ---
  2. - hosts: localhost
  3. gather_facts: False
  4. roles:
  5. - bastion-ssh-config
  6. tags: [localhost, bastion]
  7. - hosts: k8s-cluster:etcd:calico-rr
  8. any_errors_fatal: 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. - bootstrap-os
  16. tags:
  17. - bootstrap-os
  18. - hosts: k8s-cluster:etcd:calico-rr
  19. any_errors_fatal: true
  20. vars:
  21. ansible_ssh_pipelining: true
  22. gather_facts: true
  23. - hosts: k8s-cluster:etcd:calico-rr
  24. any_errors_fatal: true
  25. roles:
  26. - { role: kernel-upgrade, tags: kernel-upgrade, when: kernel_upgrade is defined and kernel_upgrade }
  27. - { role: kubernetes/preinstall, tags: preinstall }
  28. - { role: docker, tags: docker }
  29. - role: rkt
  30. tags: rkt
  31. when: "'rkt' in [etcd_deployment_type, kubelet_deployment_type, vault_deployment_type]"
  32. - hosts: etcd:k8s-cluster:vault
  33. any_errors_fatal: true
  34. roles:
  35. - { role: vault, tags: vault, vault_bootstrap: true, when: "cert_management == 'vault'" }
  36. - hosts: etcd:!k8s-cluster
  37. any_errors_fatal: true
  38. roles:
  39. - { role: etcd, tags: etcd }
  40. - hosts: k8s-cluster
  41. any_errors_fatal: true
  42. roles:
  43. - { role: etcd, tags: etcd }
  44. - hosts: etcd:k8s-cluster:vault
  45. any_errors_fatal: true
  46. roles:
  47. - { role: vault, tags: vault, when: "cert_management == 'vault'"}
  48. #Handle upgrades to master components first to maintain backwards compat.
  49. - hosts: kube-master
  50. any_errors_fatal: true
  51. serial: 1
  52. roles:
  53. - { role: upgrade/pre-upgrade, tags: pre-upgrade }
  54. - { role: kubernetes/node, tags: node }
  55. - { role: kubernetes/master, tags: master }
  56. - { role: network_plugin, tags: network }
  57. - { role: upgrade/post-upgrade, tags: post-upgrade }
  58. #Finally handle worker upgrades, based on given batch size
  59. - hosts: kube-node:!kube-master
  60. any_errors_fatal: true
  61. serial: "{{ serial | default('20%') }}"
  62. roles:
  63. - { role: upgrade/pre-upgrade, tags: pre-upgrade }
  64. - { role: kubernetes/node, tags: node }
  65. - { role: network_plugin, tags: network }
  66. - { role: upgrade/post-upgrade, tags: post-upgrade }
  67. - { role: kubernetes-apps/network_plugin, tags: network }
  68. - hosts: calico-rr
  69. any_errors_fatal: true
  70. roles:
  71. - { role: network_plugin/calico/rr, tags: network }
  72. - hosts: k8s-cluster
  73. any_errors_fatal: true
  74. roles:
  75. - { role: dnsmasq, when: "dns_mode == 'dnsmasq_kubedns'", tags: dnsmasq }
  76. - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf }
  77. - hosts: kube-master[0]
  78. any_errors_fatal: true
  79. roles:
  80. - { role: kubernetes-apps, tags: apps }