summaryrefslogtreecommitdiffstats
path: root/playbooks/openshift-master/private/set_network_facts.yml
blob: 9a6cf26fc6fd7bb5687386f2cac7e834649a1d73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- name: Read first master\'s config
  hosts: oo_first_master
  gather_facts: no
  tasks:
  - stat:
      path: "{{ openshift.common.config_base }}/master/master-config.yaml"
    register: g_master_config_stat
  - slurp:
      src: "{{ openshift.common.config_base }}/master/master-config.yaml"
    register: g_master_config_slurp

- name: Set network facts for masters
  hosts: oo_masters_to_config
  gather_facts: no
  roles:
  - role: openshift_facts
  post_tasks:
  - block:
    - set_fact:
        osm_cluster_network_cidr: "{{ (hostvars[groups.oo_first_master.0].g_master_config_slurp.content|b64decode|from_yaml).networkConfig.clusterNetworkCIDR }}"
      when: osm_cluster_network_cidr is not defined
    - set_fact:
        osm_host_subnet_length: "{{ (hostvars[groups.oo_first_master.0].g_master_config_slurp.content|b64decode|from_yaml).networkConfig.hostSubnetLength }}"
      when: osm_host_subnet_length is not defined
    - set_fact:
        openshift_portal_net: "{{ (hostvars[groups.oo_first_master.0].g_master_config_slurp.content|b64decode|from_yaml).networkConfig.serviceNetworkCIDR }}"
      when: openshift_portal_net is not defined
    - openshift_facts:
        role: common
        local_facts:
          portal_net: "{{ openshift_portal_net | default(openshift_master_portal_net) | default(None) }}"
    when:
    - hostvars[groups.oo_first_master.0].g_master_config_stat.stat.exists | bool