From 6ef472f4a2fecc3bcaf891f724fcc35d743c79b4 Mon Sep 17 00:00:00 2001 From: Teresa Ho Date: Wed, 16 Jan 2019 09:36:32 -0500 Subject: [PATCH] Add cluster-host IP for worker node in /etc/hosts mtcClient monitors the cluster-host interface and looks up the cluster-host IP address. Since the cluster-host network is not served by dnsmasq, the cluster-host IP address is not available in the dnsmasq.hosts file. This commit add the cluster-host IP address to the /etc/hosts file for worker nodes. Story: 2004273 Task: 28899 Change-Id: I80937e8809ed5d40cf57d97d34eaab6afd7d6400 Signed-off-by: Teresa Ho --- sysinv/sysinv/sysinv/sysinv/puppet/platform.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/puppet/platform.py b/sysinv/sysinv/sysinv/sysinv/puppet/platform.py index 0210470927..933bfd19ef 100644 --- a/sysinv/sysinv/sysinv/sysinv/puppet/platform.py +++ b/sysinv/sysinv/sysinv/sysinv/puppet/platform.py @@ -39,7 +39,6 @@ class PlatformPuppet(base.BasePuppet): def get_system_config(self): config = {} config.update(self._get_system_config()) - config.update(self._get_hosts_config()) config.update(self._get_amqp_config()) config.update(self._get_resolv_config()) config.update(self._get_haproxy_config()) @@ -61,6 +60,7 @@ class PlatformPuppet(base.BasePuppet): def get_host_config(self, host): config = {} + config.update(self._get_hosts_config(host)) config.update(self._get_host_platform_config(host, self.config_uuid)) config.update(self._get_host_ntp_config(host)) config.update(self._get_host_ptp_config(host)) @@ -96,7 +96,7 @@ class PlatformPuppet(base.BasePuppet): 'platform::params::vswitch_type': self._vswitch_type(), } - def _get_hosts_config(self): + def _get_hosts_config(self, host): # list of host tuples (host name, address name, newtork type) that need # to be populated in the /etc/hosts file hostnames = [ @@ -186,6 +186,10 @@ class PlatformPuppet(base.BasePuppet): (constants.STORAGE_1_HOSTNAME + HOSTNAME_INFRA_SUFFIX, constants.STORAGE_1_HOSTNAME, constants.NETWORK_TYPE_CLUSTER_HOST), + + (host.hostname + HOSTNAME_INFRA_SUFFIX, + host.hostname, + constants.NETWORK_TYPE_CLUSTER_HOST), ] hosts = {}