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 | |
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')
-rw-r--r-- | utils/src/ooinstall/cli_installer.py | 4 | ||||
-rw-r--r-- | utils/src/ooinstall/openshift_ansible.py | 22 |
2 files changed, 16 insertions, 10 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index 812a42795..c62461ad3 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -270,11 +270,11 @@ https://docs.openshift.org/latest/install_config/install/advanced_install.html#m """ confirm_continue(message) - nodes = [host.node for host in oo_cfg.hosts] + nodes = [host for host in oo_cfg.hosts if host.node] if len(masters) == len(nodes): message = """ No dedicated Nodes specified. By default, colocated Masters have their Nodes -set to unscheduleable. Continuing at this point will lable all nodes as +set to unscheduleable. Continuing at this point will label all nodes as scheduleable. """ confirm_continue(message) 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') |