setup_scale_group_facts.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. - name: Add masters to requisite groups
  3. add_host:
  4. name: "{{ hostvars[item].gce_name }}"
  5. groups: masters, etcd
  6. with_items: "{{ groups['tag_ocp-master'] }}"
  7. - name: Add a master to the primary masters group
  8. add_host:
  9. name: "{{ hostvars[item].gce_name }}"
  10. groups: primary_master
  11. with_items: "{{ groups['tag_ocp-master'].0 }}"
  12. - name: Add non-bootstrapping master node instances to node group
  13. add_host:
  14. name: "{{ hostvars[item].gce_name }}"
  15. groups: nodes
  16. openshift_node_labels:
  17. role: infra
  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
  23. openshift_node_labels:
  24. role: infra
  25. with_items: "{{ groups['tag_ocp-infra-node'] | default([]) | difference(groups['tag_ocp-bootstrap'] | default([])) }}"
  26. - name: Add node instances to node group
  27. add_host:
  28. name: "{{ hostvars[item].gce_name }}"
  29. groups: nodes
  30. openshift_node_labels:
  31. role: app
  32. with_items: "{{ groups['tag_ocp-node'] | default([]) | difference(groups['tag_ocp-bootstrap'] | default([])) }}"
  33. - name: Add bootstrap node instances
  34. add_host:
  35. name: "{{ hostvars[item].gce_name }}"
  36. groups: bootstrap_nodes
  37. openshift_node_bootstrap: True
  38. with_items: "{{ groups['tag_ocp-node'] | default([]) | intersect(groups['tag_ocp-bootstrap'] | default([])) }}"
  39. when: not (openshift_node_bootstrap | default(False))