diff --git a/elements/puppet-stack-config/puppet-stack-config.pp b/elements/puppet-stack-config/puppet-stack-config.pp index c72ad3524..7008c9a55 100644 --- a/elements/puppet-stack-config/puppet-stack-config.pp +++ b/elements/puppet-stack-config/puppet-stack-config.pp @@ -50,7 +50,7 @@ Exec<| title == 'mistral-db-populate' |> { refreshonly => false } Exec<| title == 'zaqar-manage db_sync' |> { refreshonly => false } if count(hiera('ntp::servers')) > 0 { - include ::ntp + include ::tripleo::profile::base::time::ntp } include ::rabbitmq diff --git a/elements/puppet-stack-config/puppet-stack-config.yaml.template b/elements/puppet-stack-config/puppet-stack-config.yaml.template index 7670c0933..ffe1f877d 100644 --- a/elements/puppet-stack-config/puppet-stack-config.yaml.template +++ b/elements/puppet-stack-config/puppet-stack-config.yaml.template @@ -7,8 +7,7 @@ debug: {{UNDERCLOUD_DEBUG}} controller_host: {{LOCAL_IP}} #local-ipv4 controller_admin_vip: {{UNDERCLOUD_ADMIN_VIP}} controller_public_vip: {{UNDERCLOUD_PUBLIC_VIP}} -ntp::servers: - - +ntp::servers: {{UNDERCLOUD_NTP_SERVERS}} sysctl_settings: net.ipv4.ip_nonlocal_bind: diff --git a/instack_undercloud/undercloud.py b/instack_undercloud/undercloud.py index bedd8ddf8..e8fc7e310 100644 --- a/instack_undercloud/undercloud.py +++ b/instack_undercloud/undercloud.py @@ -154,6 +154,9 @@ _opts = [ help=('Virtual IP address to use for the admin endpoints of ' 'Undercloud services. Only used with SSL.') ), + cfg.ListOpt('undercloud_ntp_servers', + default=[], + help=('List of ntp servers to use.')), cfg.StrOpt('undercloud_service_certificate', default='', help=('Certificate file to use for OpenStack service SSL ' @@ -978,7 +981,6 @@ def _generate_init_data(instack_env): open(_get_template_path('net-config.json.template')).read() context['HIERADATA_OVERRIDE'] = hiera_entry - partials = {'net_config': net_config_json} renderer = pystache.Renderer(partials=partials) template = _get_template_path('config.json.template') diff --git a/releasenotes/notes/fix_ntp_configuration-1a74dd4e02a622f5.yaml b/releasenotes/notes/fix_ntp_configuration-1a74dd4e02a622f5.yaml new file mode 100644 index 000000000..848bf8378 --- /dev/null +++ b/releasenotes/notes/fix_ntp_configuration-1a74dd4e02a622f5.yaml @@ -0,0 +1,5 @@ +--- +features: + - Add a UNDERCLOUD_NTP_SERVERS configuration in undercloud.conf +fixes: + - Fixes `bug 1664537 `__ undercloud ntp configuration. diff --git a/undercloud.conf.sample b/undercloud.conf.sample index 2004dd1d0..39c59fa9d 100644 --- a/undercloud.conf.sample +++ b/undercloud.conf.sample @@ -36,6 +36,9 @@ # services. Only used with SSL. (string value) #undercloud_admin_vip = 192.0.2.3 +# List of ntp servers to use. (list value) +#undercloud_ntp_servers = + # Certificate file to use for OpenStack service SSL connections. # Setting this enables SSL for the OpenStack API endpoints, leaving it # unset disables SSL. (string value)