setup_scale_group_facts.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. - name: Add node instances to node group
  3. add_host:
  4. name: "{{ hostvars[item].gce_name }}"
  5. groups: nodes, new_nodes
  6. openshift_node_group_name: "{{ openshift_gcp_node_group_mapping['compute'] }}"
  7. with_items: "{{ groups['tag_ocp-node'] | default([]) | difference(groups['tag_ocp-bootstrap'] | default([])) }}"
  8. - name: Add bootstrap node instances
  9. add_host:
  10. name: "{{ hostvars[item].gce_name }}"
  11. groups: bootstrap_nodes
  12. openshift_is_bootstrapped: True
  13. openshift_node_group_name: "{{ openshift_gcp_node_group_mapping['compute'] }}"
  14. with_items: "{{ groups['tag_ocp-node'] | default([]) | intersect(groups['tag_ocp-bootstrap'] | default([])) }}"
  15. - name: Add bootstrap node instances as nodes
  16. add_host:
  17. name: "{{ item }}"
  18. groups: nodes, new_nodes
  19. openshift_is_bootstrapped: True
  20. with_items: "{{ groups['tag_ocp-bootstrap'] | default([]) }}"
  21. when: all_nodes | default(False)
  22. - name: Add a master to the primary masters group
  23. add_host:
  24. name: "{{ hostvars[item].gce_name }}"
  25. groups: primary_master
  26. with_items: "{{ groups['tag_ocp-master'].0 }}"
  27. - name: Add non-bootstrapping master node instances to node group
  28. add_host:
  29. name: "{{ hostvars[item].gce_name }}"
  30. groups: nodes
  31. with_items: "{{ groups['tag_ocp-master'] | default([]) | difference(groups['tag_ocp-bootstrap'] | default([])) }}"
  32. - name: Add infra node instances to node group
  33. add_host:
  34. name: "{{ hostvars[item].gce_name }}"
  35. groups: nodes, new_nodes
  36. openshift_node_group_name: "{{ openshift_gcp_node_group_mapping['infra'] }}"
  37. with_items: "{{ groups['tag_ocp-infra-node'] | default([]) | difference(groups['tag_ocp-bootstrap'] | default([])) }}"
  38. - name: Add masters to requisite groups
  39. add_host:
  40. name: "{{ hostvars[item].gce_name }}"
  41. groups: masters, etcd
  42. openshift_node_group_name: "{{ openshift_gcp_node_group_mapping['masters'] }}"
  43. with_items: "{{ groups['tag_ocp-master'] }}"