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.

58 lines
1.9 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: bastion[0]
  16. gather_facts: False
  17. roles:
  18. - { role: kubespray-defaults}
  19. - { role: bastion-ssh-config, tags: ["localhost", "bastion"]}
  20. ##Bootstrap any new workers
  21. - hosts: kube-node
  22. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  23. gather_facts: false
  24. vars:
  25. ansible_ssh_pipelining: false
  26. roles:
  27. - { role: kubespray-defaults}
  28. - { role: bootstrap-os, tags: bootstrap-os}
  29. ##We still have to gather facts about our masters and etcd nodes
  30. - hosts: k8s-cluster:etcd:calico-rr
  31. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  32. vars:
  33. ansible_ssh_pipelining: true
  34. gather_facts: true
  35. ##We need to generate the etcd certificates beforhand
  36. - hosts: etcd
  37. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  38. roles:
  39. - { role: kubespray-defaults}
  40. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  41. ##Target only workers to get kubelet installed and checking in on any new nodes
  42. - hosts: kube-node
  43. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  44. roles:
  45. - { role: kubespray-defaults}
  46. - { role: kubernetes/preinstall, tags: preinstall }
  47. - { role: container-engine, tags: "container-engine", when: deploy_container_engine|default(true) }
  48. - { role: download, tags: download, when: "not skip_downloads" }
  49. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  50. - { role: kubernetes/node, tags: node }
  51. - { role: kubernetes/kubeadm, tags: kubeadm }
  52. - { role: network_plugin, tags: network }
  53. environment: "{{proxy_env}}"