scaleup.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ---
  2. - import_playbook: ../init/evaluate_groups.yml
  3. - name: Ensure there are new_nodes
  4. hosts: localhost
  5. connection: local
  6. gather_facts: no
  7. tasks:
  8. - fail:
  9. msg: >
  10. Detected no new_nodes in inventory. Please add hosts to the
  11. new_nodes host group to add nodes.
  12. when:
  13. - g_new_node_hosts | default([]) | length == 0
  14. - fail:
  15. msg: >
  16. Please run playbooks/openshift-master/scaleup.yml if you need to
  17. scale up both masters and nodes. This playbook is only needed if
  18. you are only adding new nodes and not new masters.
  19. when:
  20. - g_new_node_hosts | default([]) | length > 0
  21. - g_new_master_hosts | default([]) | length > 0
  22. # if g_new_node_hosts is not empty, oo_nodes_to_config will be set to
  23. # g_new_node_hosts via evaluate_groups.yml
  24. - name: run the init
  25. import_playbook: ../init/main.yml
  26. vars:
  27. l_init_fact_hosts: "masters:new_nodes"
  28. l_openshift_version_set_hosts: "new_nodes"
  29. l_install_base_packages: True
  30. l_repo_hosts: "new_nodes"
  31. - name: install nodes
  32. hosts: new_nodes
  33. vars:
  34. openshift_bootstrap_endpoint: "https://{{ openshift_install_config['metadata']['name'] }}-api.{{ openshift_install_config['baseDomain'] }}:49500/config/worker"
  35. roles:
  36. - role: container_runtime
  37. tasks:
  38. - import_role:
  39. name: container_runtime
  40. tasks_from: docker_storage_setup_overlay.yml
  41. - import_role:
  42. name: container_runtime
  43. tasks_from: extra_storage_setup.yml
  44. - import_role:
  45. name: container_runtime
  46. tasks_from: package_crio.yml
  47. - import_role:
  48. name: openshift_node40
  49. tasks_from: install.yml
  50. - name: Start workers
  51. hosts: new_nodes
  52. vars:
  53. openshift_bootstrap_endpoint: "https://{{ openshift_install_config['metadata']['name'] }}-api.{{ openshift_install_config['baseDomain'] }}:49500/config/worker"
  54. tasks:
  55. - name: Wait for bootstrap endpoint to show up
  56. uri:
  57. url: "{{ openshift_bootstrap_endpoint }}"
  58. validate_certs: false
  59. delay: 10
  60. retries: 60
  61. register: result
  62. until:
  63. - "'status' in result"
  64. - result.status == 200
  65. - import_role:
  66. name: openshift_node40
  67. tasks_from: config.yml
  68. - import_role:
  69. name: openshift_node40
  70. tasks_from: systemd.yml