diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2015-11-03 10:28:27 -0500 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2015-11-03 10:28:27 -0500 |
commit | b2c2e8e2f44faee1f8f7ecd084395b9b9260e0a7 (patch) | |
tree | 7030d78350e73b0f8da299063db025acdcd44e36 /roles | |
parent | db7493a96f7e9d19360b5f386add33a857b5f738 (diff) | |
parent | 5f9d5f11ddb2285d75281025d3fe039536d43bd9 (diff) | |
download | openshift-b2c2e8e2f44faee1f8f7ecd084395b9b9260e0a7.tar.gz openshift-b2c2e8e2f44faee1f8f7ecd084395b9b9260e0a7.tar.bz2 openshift-b2c2e8e2f44faee1f8f7ecd084395b9b9260e0a7.tar.xz openshift-b2c2e8e2f44faee1f8f7ecd084395b9b9260e0a7.zip |
Merge pull request #609 from sdodson/add-all-hostnames
Add all the possible servicenames to openshift_all_hostnames
Diffstat (limited to 'roles')
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 10 | ||||
-rw-r--r-- | roles/openshift_facts/tasks/main.yml | 3 | ||||
-rw-r--r-- | roles/openshift_master_certificates/tasks/main.yml | 2 |
3 files changed, 15 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) diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml index 6301d4fc0..a46b45b8c 100644 --- a/roles/openshift_facts/tasks/main.yml +++ b/roles/openshift_facts/tasks/main.yml @@ -6,5 +6,8 @@ - ansible_version | version_compare('1.9.0', 'ne') - ansible_version | version_compare('1.9.0.1', 'ne') +- name: Ensure python-netaddr is installed + yum: pkg=python-netaddr state=installed + - name: Gather Cluster facts openshift_facts: diff --git a/roles/openshift_master_certificates/tasks/main.yml b/roles/openshift_master_certificates/tasks/main.yml index e4602337e..4b39b043a 100644 --- a/roles/openshift_master_certificates/tasks/main.yml +++ b/roles/openshift_master_certificates/tasks/main.yml @@ -34,6 +34,8 @@ - serviceaccounts.private.key - serviceaccounts.public.key +- debug: msg="{{ item.openshift.master.all_hostnames | join (',') }}" + with_items: masters_needing_certs - name: Create the master certificates if they do not already exist command: > |