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.

59 lines
1.9 KiB

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