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.

69 lines
2.5 KiB

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