diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2015-12-01 15:09:10 -0400 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2015-12-01 15:09:10 -0400 |
commit | bd43109412c1477fde8152db7e84d73c857d544f (patch) | |
tree | deda8de71998f48f7030982d39ab74178f586444 /utils/src/ooinstall/openshift_ansible.py | |
parent | d7ff5b10a3de3f7966148d9e08c0468ef3d6a7f0 (diff) | |
download | openshift-bd43109412c1477fde8152db7e84d73c857d544f.tar.gz openshift-bd43109412c1477fde8152db7e84d73c857d544f.tar.bz2 openshift-bd43109412c1477fde8152db7e84d73c857d544f.tar.xz openshift-bd43109412c1477fde8152db7e84d73c857d544f.zip |
Centralize etcd/schedulability logic for each host.
Diffstat (limited to 'utils/src/ooinstall/openshift_ansible.py')
-rw-r--r-- | utils/src/ooinstall/openshift_ansible.py | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py index e36116cc9..17196a813 100644 --- a/utils/src/ooinstall/openshift_ansible.py +++ b/utils/src/ooinstall/openshift_ansible.py @@ -58,19 +58,14 @@ def generate_inventory(hosts): base_inventory.write('\n[nodes]\n') - # TODO: It would be much better to calculate the schedulability elsewhere - # and store it on the Node object. - if set(nodes) == set(masters): - for node in nodes: - write_host(node, base_inventory, True) - else: - for node in nodes: - # TODO: Until the Master can run the SDN itself we have to configure the Masters - # as Nodes too. - schedulable = None - if node in masters: - schedulable = False - write_host(node, base_inventory, schedulable) + for node in nodes: + # Let the fact defaults decide if we're not a master: + schedulable = None + + # If the node is also a master, we must explicitly set schedulablity: + if node.master: + schedulable = node.is_schedulable_node(hosts) + write_host(node, base_inventory, schedulable) if not getattr(proxy, 'preconfigured', True): base_inventory.write('\n[lb]\n') |