summaryrefslogtreecommitdiffstats
path: root/utils/src/ooinstall
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2015-11-25 15:17:38 -0400
committerDevan Goodwin <dgoodwin@redhat.com>2015-11-25 15:17:38 -0400
commit80c166ab60c4608ac83afb865f76b4206d593818 (patch)
treee3c97725370f8cae1943b156fb281e9d055b89cf /utils/src/ooinstall
parente3071fd15f70214fe9f13b847f2cc5443716d955 (diff)
downloadopenshift-80c166ab60c4608ac83afb865f76b4206d593818.tar.gz
openshift-80c166ab60c4608ac83afb865f76b4206d593818.tar.bz2
openshift-80c166ab60c4608ac83afb865f76b4206d593818.tar.xz
openshift-80c166ab60c4608ac83afb865f76b4206d593818.zip
Explicitly set schedulable when masters == nodes.
When the masters are the only nodes in play, we need to explicitly set schedulable to True due to logic in openshift_facts.py which assumes that if the node is also a master, schedulable should be false.
Diffstat (limited to 'utils/src/ooinstall')
-rw-r--r--utils/src/ooinstall/openshift_ansible.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/utils/src/ooinstall/openshift_ansible.py b/utils/src/ooinstall/openshift_ansible.py
index 9afc9a644..84e4db61d 100644
--- a/utils/src/ooinstall/openshift_ansible.py
+++ b/utils/src/ooinstall/openshift_ansible.py
@@ -62,12 +62,12 @@ def generate_inventory(hosts):
# and store it on the Node object.
if set(nodes) == set(masters):
for node in nodes:
- write_host(node, base_inventory)
+ 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.
- scheduleable = True
+ scheduleable = None
if node in masters:
scheduleable = False
write_host(node, base_inventory, scheduleable)
@@ -112,7 +112,7 @@ def write_inventory_vars(base_inventory, multiple_masters, proxy):
base_inventory.write("openshift_master_cluster_public_hostname={}\n".format(proxy.public_hostname))
-def write_host(host, inventory, scheduleable=True):
+def write_host(host, inventory, scheduleable=None):
global CFG
facts = ''
@@ -126,8 +126,16 @@ def write_host(host, inventory, scheduleable=True):
facts += ' openshift_public_hostname={}'.format(host.public_hostname)
# TODO: For not write_host is handles both master and nodes.
# Technically only nodes will ever need this.
- if not scheduleable:
- facts += ' openshift_scheduleable=False'
+
+ # Distinguish between three states, no schedulability specified (use default),
+ # explicitly set to True, or explicitly set to False:
+ if scheduleable is None:
+ pass
+ elif scheduleable:
+ facts += ' openshift_schedulable=True'
+ elif not scheduleable:
+ facts += ' openshift_schedulable=False'
+
installer_host = socket.gethostname()
if installer_host in [host.connect_to, host.hostname, host.public_hostname]:
facts += ' ansible_connection=local'