setup_scale_group_facts.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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 as nodes
  9. add_host:
  10. name: "{{ item }}"
  11. groups: nodes, new_nodes
  12. with_items: "{{ groups['tag_ocp-bootstrap'] | default([]) }}"
  13. when: all_nodes | default(False)
  14. - name: Add non-bootstrapping master node instances to node group
  15. add_host:
  16. name: "{{ hostvars[item].gce_name }}"
  17. groups: nodes
  18. with_items: "{{ groups['tag_ocp-master'] | default([]) | difference(groups['tag_ocp-bootstrap'] | default([])) }}"
  19. - name: Add infra node instances to node group
  20. add_host:
  21. name: "{{ hostvars[item].gce_name }}"
  22. groups: nodes, new_nodes
  23. openshift_node_group_name: "{{ openshift_gcp_node_group_mapping['infra'] }}"
  24. with_items: "{{ groups['tag_ocp-infra-node'] | default([]) | difference(groups['tag_ocp-bootstrap'] | default([])) }}"
  25. - name: Add masters to requisite groups
  26. add_host:
  27. name: "{{ hostvars[item].gce_name }}"
  28. groups: masters, etcd
  29. openshift_node_group_name: "{{ openshift_gcp_node_group_mapping['masters'] }}"
  30. with_items: "{{ groups['tag_ocp-master'] }}"