Forge Home

ntp

configure and manage ntpd

21,133 downloads

17,749 latest version

3.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.7.3 (latest)
  • 0.7.2
  • 0.7.1
  • 0.7.0
  • 0.6.1
  • 0.6.0
  • 0.5.1
  • 0.5.0
released Sep 22nd 2013

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'erwbgy-ntp', '0.7.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add erwbgy-ntp
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install erwbgy-ntp --version 0.7.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

erwbgy/ntp — version 0.7.3 Sep 22nd 2013

puppet-ntp

Puppet module for managing the Network Time Server daemon (ntpd) on a Linux host. Configuration can either be a list of time server hostnames to use or a country code/continent which results in appropriate pool.ntp.org time server hosts being used.

Currently only tested on Redhat-like systems.

Parameters

servers: a list of time server hostnames

iburst: whether of not to enable the iburst option - default 'false'

country: the country code (eg. de for Germany or uk for United Kingdom)

continent: one of: europe, asia, oceania, north-america, south-america, africa

If servers is specified it takes precedence over country or continent. If only country and continent are specified then country takes precedence over continent.

If use_hiera or use_extlookup are specified then the other parameters are ignored. Hiera is checked before extlookup.

Puppet 3 Hiera configuration

Add an ntp::servers, ntp::country or ntp::continent variable to a hiera config file - for example in /etc/puppet/hieradata/common.yaml:

Add the ntp_servers variable with a list of time server hostnames (often internal hosts):

ntp::servers:
  - ntp1.domain.com

Or the ntp_country variable with a country code:

ntp::country: de

Or the ntp_continent variable with one of 'europe', 'asia', 'oceania', 'north-america', 'south-america', 'africa':

ntp::continent: africa

Examples

Use default pool.ntp.org time servers:

class { 'ntp': }

Specify a list of time servers to use:

class { 'ntp':
  servers => [ 'ntp1.domain.com', 'ntp2.domain.com' ],
}

Use time servers from a specific country, in this case the United Kingdom:

class { 'ntp':
  country => 'uk',
}

Use time servers from a specific continent, in this case Asia:

class { 'ntp':
  continent => 'asia',
}

Notes

See How do I use pool.ntp.org for details of the available NTP zones. NTP servers are not available for all countries - see the country list under each continent - so use a continent or the default pool if your country is not listed.

Testing

Tests are implemented using RSpec, rspec-puppet and puppetlabs_spec_helper. To run them you will first need to install puppetlabs_spec_helper and rspec-hiera-puppet:

# gem install puppetlabs_spec_helper rspec-hiera-puppet

Then switch to the module directory and run rake:

$ rake spec
/usr/bin/ruby -S rspec spec/classes/ntp_spec.rb --color
............

Finished in 1.02 seconds
12 examples, 0 failures

Support

License: Apache License, Version 2.0

GitHub URL: https://github.com/erwbgy/puppet-ntp