scaleup.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. - import_playbook: ../prerequisites.yml
  25. vars:
  26. l_scale_up_hosts: "oo_nodes_to_config"
  27. l_base_packages_hosts: "oo_nodes_to_config"
  28. l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_nodes_to_config"
  29. l_sanity_check_hosts: "{{ groups['oo_nodes_to_config'] | union(groups['oo_masters_to_config']) }}"
  30. - name: install nodes
  31. hosts: oo_nodes_to_config
  32. tasks:
  33. - import_role:
  34. name: openshift_node40
  35. tasks_from: install.yml
  36. - import_role:
  37. name: openshift_node40
  38. tasks_from: config.yml
  39. - import_role:
  40. name: openshift_node40
  41. tasks_from: systemd.yml