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