scaleup.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. k8s_facts:
  27. kubeconfig: "{{ kubeconfig_path }}"
  28. kind: ClusterVersion
  29. name: version
  30. register: clusterversion
  31. until:
  32. - clusterversion.resources is defined
  33. - clusterversion.resources | length > 0
  34. - clusterversion.resources[0].status is defined
  35. - clusterversion.resources[0].status.desired is defined
  36. - clusterversion.resources[0].status.desired.image is defined
  37. retries: 36
  38. delay: 5
  39. - name: install nodes
  40. hosts: new_workers
  41. tasks:
  42. - import_role:
  43. name: openshift_node40
  44. tasks_from: install.yml
  45. - name: Wait for bootstrap endpoint to show up
  46. uri:
  47. url: "{{ openshift_bootstrap_endpoint }}"
  48. validate_certs: false
  49. delay: 10
  50. retries: 60
  51. register: result
  52. until:
  53. - "'status' in result"
  54. - result.status == 200
  55. - import_role:
  56. name: openshift_node40
  57. tasks_from: config.yml
  58. vars:
  59. openshift_release_image: "{{ hostvars['localhost'].clusterversion.resources[0].status.desired.image }}"