summaryrefslogtreecommitdiffstats
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/apex/common/constants.py1
-rw-r--r--lib/python/apex/network_settings.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/python/apex/common/constants.py b/lib/python/apex/common/constants.py
index db0a9fd1..741bb4f8 100644
--- a/lib/python/apex/common/constants.py
+++ b/lib/python/apex/common/constants.py
@@ -18,6 +18,7 @@ COMPUTE = 'compute'
OPNFV_NETWORK_TYPES = [ADMIN_NETWORK, TENANT_NETWORK, EXTERNAL_NETWORK,
STORAGE_NETWORK, API_NETWORK]
DNS_SERVERS = ["8.8.8.8", "8.8.4.4"]
+NTP_SERVER = ["pool.ntp.org"]
COMPUTE = 'compute'
CONTROLLER = 'controller'
ROLES = [COMPUTE, CONTROLLER]
diff --git a/lib/python/apex/network_settings.py b/lib/python/apex/network_settings.py
index ca40ba93..c9f7d450 100644
--- a/lib/python/apex/network_settings.py
+++ b/lib/python/apex/network_settings.py
@@ -21,6 +21,7 @@ from .common.constants import (
ROLES,
DOMAIN_NAME,
DNS_SERVERS,
+ NTP_SERVER,
ADMIN_NETWORK,
EXTERNAL_NETWORK,
OPNFV_NETWORK_TYPES,
@@ -113,6 +114,7 @@ class NetworkSettings(dict):
if 'dns-domain' not in self:
self['domain_name'] = DOMAIN_NAME
self['dns_servers'] = self.get('dns_nameservers', DNS_SERVERS)
+ self['ntp_servers'] = self.get('ntp', NTP_SERVER)
def _validate_overcloud_nic_order(self, network):
"""
@@ -333,6 +335,7 @@ class NetworkSettings(dict):
bash_str += flatten('ip_addr_family', self.get_ip_addr_family())
bash_str += flatten('dns_servers', self['dns_servers'], ' ')
bash_str += flatten('domain_name', self['dns-domain'], ' ')
+ bash_str += flatten('ntp_server', self['ntp_servers'][0], ' ')
if path:
with open(path, 'w') as file:
file.write(bash_str)