set_network_facts.yml 966 B

12345678910111213141516171819202122232425262728
  1. ---
  2. - name: Read first master\'s config
  3. hosts: oo_first_master
  4. gather_facts: no
  5. tasks:
  6. - stat:
  7. path: "{{ openshift.common.config_base }}/master/master-config.yaml"
  8. register: g_master_config_stat
  9. - slurp:
  10. src: "{{ openshift.common.config_base }}/master/master-config.yaml"
  11. register: g_master_config_slurp
  12. - name: Set network facts for masters
  13. hosts: oo_masters_to_config
  14. gather_facts: no
  15. roles:
  16. - role: openshift_facts
  17. post_tasks:
  18. - block:
  19. - set_fact:
  20. openshift_portal_net: "{{ (hostvars[groups.oo_first_master.0].g_master_config_slurp.content|b64decode|from_yaml).networkConfig.serviceNetworkCIDR }}"
  21. when: openshift_portal_net is not defined
  22. - openshift_facts:
  23. role: common
  24. local_facts:
  25. portal_net: "{{ openshift_portal_net | default(openshift_master_portal_net) | default(None) }}"
  26. when:
  27. - hostvars[groups.oo_first_master.0].g_master_config_stat.stat.exists | bool