diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2015-11-24 15:05:27 -0500 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2015-11-24 16:33:12 -0500 |
commit | ed650557aef9bb1d18b755ffdf891fcb26bb20cb (patch) | |
tree | 3588c168c059d581fe44ae2463237ea15c9b58f3 /utils/src/ooinstall/openshift_ansible.py | |
parent | ba47106f21fd18c64c3a3bb89980a3e857fbd034 (diff) | |
download | openshift-ed650557aef9bb1d18b755ffdf891fcb26bb20cb.tar.gz openshift-ed650557aef9bb1d18b755ffdf891fcb26bb20cb.tar.bz2 openshift-ed650557aef9bb1d18b755ffdf891fcb26bb20cb.tar.xz openshift-ed650557aef9bb1d18b755ffdf891fcb26bb20cb.zip |
Properly setting scheduleability for HA Master scenarios
If the only Nodes we have are also on Masters we set the scheduleable.
Diffstat (limited to 'utils/src/ooinstall/openshift_ansible.py')
-rw-r--r-- | utils/src/ooinstall/openshift_ansible.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py index 66b9ead93..75125084c 100644 --- a/utils/src/ooinstall/openshift_ansible.py +++ b/utils/src/ooinstall/openshift_ansible.py @@ -57,14 +57,20 @@ def generate_inventory(hosts): write_host(master, base_inventory) base_inventory.write('\n[nodes]\n') - for node in nodes: - # TODO: Until the Master can run the SDN itself we have to configure the Masters - # as Nodes too. - scheduleable = True - # If there's only one Node and it's also a Master we want it to be scheduleable: - if node in masters and len(masters) != len(nodes): - scheduleable = False - write_host(node, base_inventory, scheduleable) + + # TODO: It would be much better to calculate the scheduleability elsewhere + # and store it on the Node object. + if set(nodes) == set(masters): + for node in nodes: + write_host(node, base_inventory) + else: + for node in nodes: + # TODO: Until the Master can run the SDN itself we have to configure the Masters + # as Nodes too. + scheduleable = True + if node in masters: + scheduleable = False + write_host(node, base_inventory, scheduleable) if not getattr(proxy, 'preconfigured', True): base_inventory.write('\n[lb]\n') |