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.

67 lines
2.5 KiB

  1. ---
  2. - name: Check ansible version
  3. import_playbook: ansible_version.yml
  4. - hosts: all
  5. gather_facts: false
  6. tasks:
  7. - name: "Set up proxy environment"
  8. set_fact:
  9. proxy_env:
  10. http_proxy: "{{ http_proxy | default ('') }}"
  11. HTTP_PROXY: "{{ http_proxy | default ('') }}"
  12. https_proxy: "{{ https_proxy | default ('') }}"
  13. HTTPS_PROXY: "{{ https_proxy | default ('') }}"
  14. no_proxy: "{{ no_proxy | default ('') }}"
  15. NO_PROXY: "{{ no_proxy | default ('') }}"
  16. no_log: true
  17. - hosts: bastion[0]
  18. gather_facts: False
  19. roles:
  20. - { role: kubespray-defaults }
  21. - { role: bastion-ssh-config, tags: ["localhost", "bastion"] }
  22. - name: Bootstrap any new workers
  23. hosts: kube-node
  24. strategy: linear
  25. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  26. gather_facts: false
  27. roles:
  28. - { role: kubespray-defaults }
  29. - { role: bootstrap-os, tags: bootstrap-os}
  30. - name: Gather facts
  31. import_playbook: facts.yml
  32. - name: Generate the etcd certificates beforehand
  33. hosts: etcd
  34. gather_facts: False
  35. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  36. roles:
  37. - { role: kubespray-defaults }
  38. - { role: etcd, tags: etcd, etcd_cluster_setup: false }
  39. - name: Download images to ansible host cache via first kube-master node
  40. hosts: kube-master[0]
  41. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  42. roles:
  43. - { role: kubespray-defaults, when: "not skip_downloads and download_run_once and not download_localhost"}
  44. - { role: kubernetes/preinstall, tags: preinstall, when: "not skip_downloads and download_run_once and not download_localhost" }
  45. - { role: download, tags: download, when: "not skip_downloads and download_run_once and not download_localhost" }
  46. - name: Target only workers to get kubelet installed and checking in on any new nodes
  47. hosts: kube-node
  48. gather_facts: False
  49. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  50. roles:
  51. - { role: kubespray-defaults }
  52. - { role: kubernetes/preinstall, tags: preinstall }
  53. - { role: container-engine, tags: "container-engine", when: deploy_container_engine|default(true) }
  54. - { role: download, tags: download, when: "not skip_downloads" }
  55. - { role: etcd, tags: etcd, etcd_cluster_setup: false, when: "not etcd_kubeadm_enabled|default(false)" }
  56. - { role: kubernetes/node, tags: node }
  57. - { role: kubernetes/kubeadm, tags: kubeadm }
  58. - { role: network_plugin, tags: network }
  59. - { role: kubernetes/node-label, tags: node-label }
  60. environment: "{{ proxy_env }}"