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.

86 lines
3.1 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. gather_facts: False
  44. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  45. roles:
  46. - { role: kubespray-defaults, when: "not skip_downloads and download_run_once and not download_localhost" }
  47. - { role: kubernetes/preinstall, tags: preinstall, when: "not skip_downloads and download_run_once and not download_localhost" }
  48. - { role: download, tags: download, when: "not skip_downloads and download_run_once and not download_localhost" }
  49. - name: Target only workers to get kubelet installed and checking in on any new nodes(engine)
  50. hosts: kube-node
  51. gather_facts: False
  52. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  53. roles:
  54. - { role: kubespray-defaults }
  55. - { role: kubernetes/preinstall, tags: preinstall }
  56. - { role: container-engine, tags: "container-engine", when: deploy_container_engine|default(true) }
  57. - { role: download, tags: download, when: "not skip_downloads" }
  58. - { role: etcd, tags: etcd, etcd_cluster_setup: false, when: "not etcd_kubeadm_enabled|default(false)" }
  59. environment: "{{ proxy_env }}"
  60. - name: Target only workers to get kubelet installed and checking in on any new nodes(node)
  61. hosts: kube-node
  62. gather_facts: False
  63. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  64. roles:
  65. - { role: kubespray-defaults }
  66. - { role: kubernetes/node, tags: node }
  67. environment: "{{ proxy_env }}"
  68. - name: Target only workers to get kubelet installed and checking in on any new nodes(network)
  69. hosts: kube-node
  70. gather_facts: False
  71. any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
  72. roles:
  73. - { role: kubespray-defaults }
  74. - { role: kubernetes/kubeadm, tags: kubeadm }
  75. - { role: network_plugin, tags: network }
  76. - { role: kubernetes/node-label, tags: node-label }
  77. environment: "{{ proxy_env }}"