Merge "Stop ntpd before calling ntpdate"

This commit is contained in:
Jenkins 2013-02-08 12:24:00 +00:00 committed by Gerrit Code Review
commit f6a0b0781b

View File

@ -66,6 +66,13 @@ file {'ntp_config':
content => $config_content, content => $config_content,
} }
exec {'stop-ntpd':
command => $operatingsystem ? {
'Fedora' => '/usr/bin/systemctl stop ntpd.service',
/(RedHat|CentOS|Scientific)/ => '/sbin/service ntpd stop',
},
}
exec {'ntpdate': exec {'ntpdate':
command => '/usr/sbin/ntpdate %(CONFIG_NTP_FIRST_SERVER)s', command => '/usr/sbin/ntpdate %(CONFIG_NTP_FIRST_SERVER)s',
} }
@ -78,4 +85,4 @@ service {'ntpd':
hasrestart => true, hasrestart => true,
} }
Package['ntp'] -> File['ntp_config'] -> Exec['ntpdate'] -> Service['ntpd'] Package['ntp'] -> File['ntp_config'] -> Exec['stop-ntpd'] -> Exec['ntpdate'] -> Service['ntpd']