[ovirt-users] chrony or ntp ?

Christopher Cox ccox at endlessnow.com
Sun Jun 11 20:48:48 UTC 2017


On 06/11/2017 04:19 AM, Fabrice Bacchella wrote:
>
>> Le 10 juin 2017 à 22:21, Michal Skrivanek <mskrivan at redhat.com> a écrit :
>>
>>> On 09 Jun 2017, at 15:48, Fabrice Bacchella <fabrice.bacchella at orange.fr> wrote:
>>>
>>>
>>> People might be suprised. I'm currently trying to understand what chrony did to my ntpd setup, it look like it killed it and puppet has hard time to reconfigure it.
>>>
>>> And as it's not a 'ovirt update' but instead vdsm update seems to happen more frequently, some people might forget to read release notes and be disappointed.
>>
>> We do not configure anything. Just pull in dependency. You're free to
>> disable the service as a common admin task. As long as you replace it
>> with other time synchronization solution
>
> Yes, that's I've done, but beware of user complain about broken ntp service because their specially crafted ntpd configuration now lying dead. I detected it because my puppet setup tried to uninstall chrony and failed. What about other users ? Does the default chrony settings always works, for every one ?


Since you mentioned puppet, here's out puppet pp and template erb we use, hope 
it help.  IMHO, ntp has problems that chrony doesn't have:

chrony/manifests/init.pp:

# This class is really only for CentOS 7 or higher.
#
class chrony (
   $stratumweight      = 0,
   $driftfile          = '/var/lib/chrony/drift',
   $keyfile            = '/etc/chrony.keys',
   $keyfile_commandkey = 1,
   $generatecommandkey = true,
   $logdir             = '/var/log/chrony',
   $noclientlog        = true,
   $logchange          = '0.5',
   $makestep_enable    = true,
   $makestep_threshold = 10,
   $makestep_update    = -1,
   $bindcmdaddress     = '127.0.0.1',
   $servers            = ['ntp1.example.com', 'ntp2.example.com'],
   $iburst_enable      = true,
   $rtcsync_enable     = false,) {
   if $operatingsystem in ['CentOS', 'RedHat'] and ($::operatingsystemmajrelease 
+ 0) >= 7 {
     ensure_packages(['chrony'])
     # Red Hat, CentOS don't readily have ability to change location of conf
     #  file.
     $conf_file = '/etc/chrony.conf'

     service { 'chronyd':
       ensure  => 'running',
       enable  => true,
       require => Package['chrony'],
     }

     file { $conf_file:
       ensure  => present,
       group   => 'root',
       mode    => '644',
       owner   => 'root',
       content => template('chrony/chrony_conf.erb'),
       notify  => Service['chronyd'],
       require => Package['chrony'],
     }
   } else {
     notify { 'chrony only supported in CentOS/RHEL 7 or greater': }

     exec { '/bin/false': }
   }
}

chrony/templates/chrony_conf.erb

<% @servers.flatten.each do |server| -%>
server <%= server %><% if @iburst_enable == true -%> iburst<% end -%>

<% end -%>

<% if @stratumweight -%>
stratumweight <%= @stratumweight %>
<% end -%>
<% if @driftfile -%>
driftfile <%= @driftfile %>
<% end -%>
<% if @makestep_enable == true -%>
makestep <%= @makestep_threshold %> <%= @makestep_update %>
<% end -%>
<% if @rtcsync_enable == true -%>
rtcsync
<% end -%>
<% if @bindcmdaddress -%>
bindcmdaddress <%= @bindcmdaddress %>
<% end -%>
<% if @keyfile -%>
keyfile <%= @keyfile %>
<%   if @keyfile_commandkey -%>
commandkey <%= @keyfile_commandkey %>
<%   else -%>
commandkey 0
<%   end -%>
<%   if @generatecommandkey == true -%>
generatecommandkey
<%   end -%>
<% end -%>
<% if @noclientlog -%>
noclientlog
<% end -%>
<% if @logchange -%>
logchange <%= @logchange %>
<% end -%>
<% if @logdir -%>
logdir <%= @logdir %>
<% end -%>





More information about the Users mailing list