This will configure the NTP service. It can also correct time offsets.
- Ubuntu
- Debian
- Rhel
- Fedora
node['ntp']['aggressive'](boolean) defaults totrue, whentrueit will stop the NTP service and correct the offset if its above the offset limit on each Chef runnode['ntp']['offset_limit'](int) defaults to100, maximum offset time in millisecondsnode['ntp']['servers'](hash) servers to poll for ntp queries
Here's an example base role that have some NTP configs.
name 'base'
description 'things for our base image!'
override_attributes(
...
'ntp' => {
'aggressive' => true,
'offset_limit' => 100,
'servers' => %w(
1.north-america.pool.ntp.org
tick.ucla.edu
ntp.colby.edu
)
}
...
)
run_list(
'..., recipe[cop_ntp], ...'
)NOTE: You will be required to include a depends for this cookbook inside YOUR cookbook's metadata.rb file.
...
depends 'cop_ntp', git: 'git@github.com:copious-cookbooks/ntp.git'
...