Merge "Stop ntpd before calling ntpdate"
This commit is contained in:
commit
f6a0b0781b
@ -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']
|
||||||
|
Loading…
Reference in New Issue
Block a user