summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/dynamic_inventory.py
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-06-04 20:59:38 +0100
committerMarkos Chandras <mchandras@suse.de>2018-06-06 15:17:05 +0100
commita82590eb643383127abea5dc7320445e03d7a9c2 (patch)
tree68e7a521e90d0f3466ed34a48666fa4d256a9a17 /xci/playbooks/dynamic_inventory.py
parent246029cfa3b70cb3e5678a41187b214620f6d507 (diff)
roles: bootstrap-host: Ensure DNS info from IDF is respected
We are configuring static IPs in the various nodes but we don't do anything for DNS assuming that DNS is being configured by another entity. However, the IDF file already contains DNS information for us so we should use that instead. Moreover, we update the IDF file to use the gateway as DNS instead of the Google one in order to make it more usable on restricted networks. Change-Id: Ieba58ec9558080a1296e204c4f99bae859e9daef Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/dynamic_inventory.py')
-rwxr-xr-xxci/playbooks/dynamic_inventory.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/xci/playbooks/dynamic_inventory.py b/xci/playbooks/dynamic_inventory.py
index 6d9d217f..b5c4609b 100755
--- a/xci/playbooks/dynamic_inventory.py
+++ b/xci/playbooks/dynamic_inventory.py
@@ -47,6 +47,7 @@ class XCIInventory(object):
self.opnfv_networks['opnfv']['public'] = {}
self.opnfv_networks['opnfv']['public']['address'] = '192.168.122.2/24'
self.opnfv_networks['opnfv']['public']['gateway'] = '192.168.122.1'
+ self.opnfv_networks['opnfv']['public']['dns'] = '192.168.122.1'
self.opnfv_networks['opnfv']['private'] = {}
self.opnfv_networks['opnfv']['private']['address'] = '172.29.240.10/22'
self.opnfv_networks['opnfv']['storage'] = {}
@@ -110,6 +111,8 @@ class XCIInventory(object):
host_networks[hostname][network]['address'] = pdf_host_info['interfaces'][int(network_interface_num)]['address'] + "/" + str(ndata['mask'])
if 'gateway' in ndata.keys():
host_networks[hostname][network]['gateway'] = str(ndata['gateway']) + "/" + str(ndata['mask'])
+ if 'dns' in ndata.keys():
+ host_networks[hostname][network]['dns'] = str(ndata['dns'])
host_networks.update(self.opnfv_networks)