From 151e25cc0ff12dd046efcdd61fa5a1ad21a96ac5 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Tue, 24 Jan 2017 21:15:25 -0500 Subject: override nodename for gce with cloudprovider --- roles/openshift_facts/library/openshift_facts.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'roles/openshift_facts/library') diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index c99452062..f7506bd63 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -1032,6 +1032,8 @@ def set_nodename(facts): if 'node' in facts and 'common' in facts: if 'cloudprovider' in facts and facts['cloudprovider']['kind'] == 'openstack': facts['node']['nodename'] = facts['provider']['metadata']['hostname'].replace('.novalocal', '') + elif 'cloudprovider' in facts and facts['cloudprovider']['kind'] == 'gce': + facts['node']['nodename'] = '.'.split(facts['provider']['metadata']['hostname'])[0] else: facts['node']['nodename'] = facts['common']['hostname'].lower() return facts -- cgit v1.2.3