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.

71 lines
2.4 KiB

  1. ---
  2. - hosts: localhost
  3. gather_facts: False
  4. tasks:
  5. - name: "Check ansible version !=2.7.0"
  6. assert:
  7. msg: "Ansible V2.7.0 can't be used until: https://github.com/ansible/ansible/issues/46600 is fixed"
  8. that:
  9. - ansible_version.string is version("2.7.0", "!=")
  10. - ansible_version.string is version("2.5.0", ">=")
  11. tags:
  12. - check
  13. vars:
  14. ansible_connection: local
  15. - hosts: localhost
  16. tasks:
  17. - name: deploy warning for non kubeadm
  18. debug:
  19. msg: "DEPRECATION: non-kubeadm deployment is deprecated from v2.9. Will be removed in next release."
  20. when: not kubeadm_enabled and not skip_non_kubeadm_warning
  21. - name: deploy cluster for non kubeadm
  22. pause:
  23. prompt: "Are you sure you want to deploy cluster using the deprecated non-kubeadm mode."
  24. echo: no
  25. when: not kubeadm_enabled and not skip_non_kubeadm_warning
  26. - hosts: bastion[0]
  27. gather_facts: False
  28. roles:
  29. - { role: kubespray-defaults}
  30. - { role: bastion-ssh-config, tags: ["localhost", "bastion"]}
  31. ##Bootstrap any new workers
  32. - hosts: kube-node
  33. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  34. gather_facts: false
  35. vars:
  36. ansible_ssh_pipelining: false
  37. roles:
  38. - { role: kubespray-defaults}
  39. - { role: bootstrap-os, tags: bootstrap-os}
  40. ##We still have to gather facts about our masters and etcd nodes
  41. - hosts: k8s-cluster:etcd:calico-rr
  42. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  43. vars:
  44. ansible_ssh_pipelining: true
  45. gather_facts: true
  46. ##We need to generate the etcd certificates beforhand
  47. - hosts: etcd
  48. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  49. roles:
  50. - { role: kubespray-defaults}
  51. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  52. ##Target only workers to get kubelet installed and checking in on any new nodes
  53. - hosts: kube-node
  54. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  55. roles:
  56. - { role: kubespray-defaults}
  57. - { role: kubernetes/preinstall, tags: preinstall }
  58. - { role: container-engine, tags: "container-engine", when: deploy_container_engine|default(true) }
  59. - { role: download, tags: download, when: "not skip_downloads" }
  60. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  61. - { role: kubernetes/node, tags: node }
  62. - { role: kubernetes/kubeadm, tags: kubeadm, when: "kubeadm_enabled" }
  63. - { role: network_plugin, tags: network }
  64. environment: "{{proxy_env}}"