summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts/library
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2015-09-23 18:13:19 -0400
committerScott Dodson <sdodson@redhat.com>2015-11-03 09:27:11 -0500
commit5f9d5f11ddb2285d75281025d3fe039536d43bd9 (patch)
tree6b0128d33567c13f009528b1cafd906536016319 /roles/openshift_facts/library
parent94c5c1fe5c280054132077dedcc1d0b96558a91f (diff)
downloadopenshift-5f9d5f11ddb2285d75281025d3fe039536d43bd9.tar.gz
openshift-5f9d5f11ddb2285d75281025d3fe039536d43bd9.tar.bz2
openshift-5f9d5f11ddb2285d75281025d3fe039536d43bd9.tar.xz
openshift-5f9d5f11ddb2285d75281025d3fe039536d43bd9.zip
Add all the possible servicenames to openshift_all_hostnames for masters
Diffstat (limited to 'roles/openshift_facts/library')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index e5aeb9244..163e67f62 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -22,6 +22,7 @@ import copy
import os
from distutils.util import strtobool
from distutils.version import LooseVersion
+from netaddr import IPNetwork
def hostname_valid(hostname):
@@ -486,12 +487,21 @@ def set_aggregate_facts(facts):
if 'common' in facts:
all_hostnames.add(facts['common']['hostname'])
all_hostnames.add(facts['common']['public_hostname'])
+ all_hostnames.add(facts['common']['ip'])
+ all_hostnames.add(facts['common']['public_ip'])
if 'master' in facts:
+ # FIXME: not sure why but facts['dns']['domain'] fails
+ cluster_domain = 'cluster.local'
if 'cluster_hostname' in facts['master']:
all_hostnames.add(facts['master']['cluster_hostname'])
if 'cluster_public_hostname' in facts['master']:
all_hostnames.add(facts['master']['cluster_public_hostname'])
+ all_hostnames.update(['openshift', 'openshift.default', 'openshift.default.svc',
+ 'openshift.default.svc.' + cluster_domain, 'kubernetes', 'kubernetes.default',
+ 'kubernetes.default.svc', 'kubernetes.default.svc.' + cluster_domain])
+ first_svc_ip = str(IPNetwork(facts['master']['portal_net'])[1])
+ all_hostnames.add(first_svc_ip)
facts['common']['all_hostnames'] = list(all_hostnames)