Merge "Expose timezone configuration"
This commit is contained in:
commit
01f40202c2
12
releasenotes/notes/undercloud-timezone-052a6c1c05e80850.yaml
Normal file
12
releasenotes/notes/undercloud-timezone-052a6c1c05e80850.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Host timezone can be managed during the undercloud installation. The default
|
||||||
|
timezone is the timezone already configured for the system. The timezone
|
||||||
|
can be configured by setting undercloud_timezone in undercloud.conf
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Host timezone can be managed during the undercloud upgrade. The default
|
||||||
|
timezone is the timezone already configured for the system. The timezone
|
||||||
|
can be configured by setting undercloud_timezone in undercloud.conf and it
|
||||||
|
is recommended to set this going forward.
|
@ -130,6 +130,10 @@ class UndercloudConfig(StandaloneConfig):
|
|||||||
default=['0.pool.ntp.org', '1.pool.ntp.org',
|
default=['0.pool.ntp.org', '1.pool.ntp.org',
|
||||||
'2.pool.ntp.org', '3.pool.ntp.org'],
|
'2.pool.ntp.org', '3.pool.ntp.org'],
|
||||||
help=_('List of ntp servers to use.')),
|
help=_('List of ntp servers to use.')),
|
||||||
|
cfg.StrOpt('undercloud_timezone', default=None,
|
||||||
|
help=_('Host timezone to be used. If no timezone is '
|
||||||
|
'specified, the existing timezone configuration '
|
||||||
|
'is used.')),
|
||||||
cfg.StrOpt('overcloud_domain_name',
|
cfg.StrOpt('overcloud_domain_name',
|
||||||
default='localdomain',
|
default='localdomain',
|
||||||
help=_(
|
help=_(
|
||||||
|
@ -71,6 +71,7 @@ class TestUndercloudConfig(base.TestCase):
|
|||||||
'undercloud_ntp_servers',
|
'undercloud_ntp_servers',
|
||||||
'undercloud_public_host',
|
'undercloud_public_host',
|
||||||
'undercloud_service_certificate',
|
'undercloud_service_certificate',
|
||||||
|
'undercloud_timezone',
|
||||||
'undercloud_update_packages',
|
'undercloud_update_packages',
|
||||||
'upgrade_cleanup']
|
'upgrade_cleanup']
|
||||||
self.assertEqual(expected, [x.name for x in ret])
|
self.assertEqual(expected, [x.name for x in ret])
|
||||||
@ -133,6 +134,7 @@ class TestUndercloudConfig(base.TestCase):
|
|||||||
'undercloud_ntp_servers',
|
'undercloud_ntp_servers',
|
||||||
'undercloud_public_host',
|
'undercloud_public_host',
|
||||||
'undercloud_service_certificate',
|
'undercloud_service_certificate',
|
||||||
|
'undercloud_timezone',
|
||||||
'undercloud_update_packages',
|
'undercloud_update_packages',
|
||||||
'upgrade_cleanup']
|
'upgrade_cleanup']
|
||||||
self.assertEqual(expected, [x.name for x in ret])
|
self.assertEqual(expected, [x.name for x in ret])
|
||||||
|
@ -32,6 +32,7 @@ from jinja2 import meta
|
|||||||
|
|
||||||
from osc_lib.i18n import _
|
from osc_lib.i18n import _
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from time import strftime
|
||||||
from tripleo_common.image import kolla_builder
|
from tripleo_common.image import kolla_builder
|
||||||
|
|
||||||
from tripleoclient.config.undercloud import load_global_config
|
from tripleoclient.config.undercloud import load_global_config
|
||||||
@ -383,6 +384,11 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
|
|||||||
if CONF.get('undercloud_ntp_servers', None):
|
if CONF.get('undercloud_ntp_servers', None):
|
||||||
env_data['NtpServer'] = CONF['undercloud_ntp_servers']
|
env_data['NtpServer'] = CONF['undercloud_ntp_servers']
|
||||||
|
|
||||||
|
if CONF.get('undercloud_timezone', None):
|
||||||
|
env_data['TimeZone'] = CONF['undercloud_timezone']
|
||||||
|
else:
|
||||||
|
env_data['TimeZone'] = strftime("%Z")
|
||||||
|
|
||||||
if CONF.get('enable_validations', False):
|
if CONF.get('enable_validations', False):
|
||||||
env_data['UndercloudConfigFilePath'] = constants.UNDERCLOUD_CONF_PATH
|
env_data['UndercloudConfigFilePath'] = constants.UNDERCLOUD_CONF_PATH
|
||||||
if not no_validations:
|
if not no_validations:
|
||||||
|
Loading…
Reference in New Issue
Block a user