scaleup.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ---
  2. - name: Pre-scaleup checks
  3. hosts: localhost
  4. connection: local
  5. gather_facts: no
  6. tasks:
  7. - fail:
  8. msg: >
  9. Detected no new_workers in inventory. Please add hosts to the
  10. new_workers host group to add nodes.
  11. when: groups.new_workers | default([]) | length == 0
  12. - name: run the init
  13. import_playbook: ../init/main.yml
  14. vars:
  15. l_init_fact_hosts: "new_workers"
  16. l_openshift_version_set_hosts: "new_workers"
  17. l_install_base_packages: True
  18. l_repo_hosts: "new_workers"
  19. l_base_packages_hosts: "new_workers"
  20. - name: Get release image
  21. hosts: localhost
  22. connection: local
  23. gather_facts: no
  24. tasks:
  25. - name: Get release image
  26. oc_obj:
  27. kubeconfig: "{{ kubeconfig_path }}"
  28. state: present
  29. kind: clusterversion.config.openshift.io
  30. name: version
  31. register: clusterversion
  32. until:
  33. - clusterversion.results is defined
  34. - clusterversion.results.returncode is defined
  35. - clusterversion.results.returncode == 0
  36. - clusterversion.results.results is defined
  37. - clusterversion.results.results | length > 0
  38. - clusterversion.results.results[0].status is defined
  39. - clusterversion.results.results[0].status.desired is defined
  40. - clusterversion.results.results[0].status.desired.image is defined
  41. retries: 5
  42. delay: 5
  43. - name: install nodes
  44. hosts: new_workers
  45. roles:
  46. - role: container_runtime
  47. tasks:
  48. - import_role:
  49. name: container_runtime
  50. tasks_from: docker_storage_setup_overlay.yml
  51. - import_role:
  52. name: container_runtime
  53. tasks_from: extra_storage_setup.yml
  54. - import_role:
  55. name: container_runtime
  56. tasks_from: package_crio.yml
  57. - import_role:
  58. name: openshift_node40
  59. tasks_from: install.yml
  60. - name: Wait for bootstrap endpoint to show up
  61. uri:
  62. url: "{{ openshift_bootstrap_endpoint }}"
  63. validate_certs: false
  64. delay: 10
  65. retries: 60
  66. register: result
  67. until:
  68. - "'status' in result"
  69. - result.status == 200
  70. - import_role:
  71. name: openshift_node40
  72. tasks_from: config.yml
  73. vars:
  74. openshift_release_image: "{{ hostvars['localhost'].clusterversion.results.results[0].status.desired.image }}"