puppetlabs-ntp-7.1.10040755005276200011600000000000013237313253011411 5ustar00puppetlabs-ntp-7.1.1/CHANGELOG.md0100644005276200011600000003611713237313141013302 0ustar00# Change log All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). ## Supported Release 7.1.1 ### Summary This release includes updates Japanese translations. ### Added - Updating translations for readmes/README_ja_JP.md ## Supported Release 7.1.0 ### Summary This release uses the PDK convert functionality which in return makes the module PDK compliant. It also includes one feature and a roll up of maintenance changes. ### Added - PDK convert ntp ([MODULES-6326](https://tickets.puppet.com/browse/MODULES-6326)). - Create parameter for slewalways to be exposed in the ntp.conf template. ### Fixed - `is_virtual` fact is boolean and cant be given to str2bool. - Don't use 'inherits' in config, install and service. - Roll up of modulesync changes. - Make documentation more readable. - Fix up rubocop errors ([FM-6634](https://tickets.puppet.com/browse/FM-6634)). - Strip data types out of puppet-strings comments. ## Supported Release 7.0.0 ### Summary Hiera 5 only works with Puppet 4.9.4 and above, we have bumped the Puppet requirement for the module accordingly. ### Changed - Update YAML to version 5 ([PR 428](https://github.com/puppetlabs/puppetlabs-ntp/pull/428)) - Updates the lower puppet version boundary to 4.9.4. ## Supported Release 6.4.1 ### Summary This release reverts a PR that implements Hiera 5. Issues have been seen due to compatibility issues. The issues that have been seen are ([MODULES-5775](https://tickets.puppet.com/browse/MODULES-5775)) and ([MODULES-5780](https://tickets.puppet.com/browse/MODULES-5780)). ### Changed - Reverts ([PR 394](https://github.com/puppetlabs/puppetlabs-ntp/pull/394)) ## Supported Release 6.4.0 ### Summary This release is to both update the modules code so that it matches the set standards and make it so that all future prs are checked by Rubocop before release. #### Added - Rubocop is now enabled. #### Changed - All ruby code within module has been altered to match standards. ## Supported Release 6.3.0 ### Summary This is a feature release with some bugfixes and updated Japanese translations, too. #### Added - `enable_mode7` parameter (defaults to `false`) - disable monitor availability while setting stat properties #### Changed - Lower bound of Puppet requirement from 4.5.0 to 4.7.0 - hiera.yaml to Hiera version 5 format #### Removed - Ubuntu 10.04 and 12.04, Debian 6, SLES 10 SP4, and Fedora 20-23 support from metadata.json (existing compatibility remains) #### Fixed - Path to driftfile on Suse ([MODULES-4941](https://tickets.puppet.com/browse/MODULES-4941)) - Whitespace issue in ntp.conf.epp with `tos` - Permissions on keys file ## Supported Release 6.2.0 ### Summary This is a small minor release that adds the `pool` parameter and revises some Japanese translations. #### Added - The `pool` parameter #### Fixed - Japanese translations for the README ## Supported Release 6.1.0 ### Summary This release adds support for internationalization of the module. It also contains Japanese translations for the README, summary and description of the metadata.json and major cleanups in the README. Additional folders have been introduced called locales and readmes where translation files can be found. A number of features and bug fixes are also included in this release. #### Features - Addition of POT file for metadata translation for i18n. - Multiple Gemfile updates for Ruby and Gems support. - (MODULES-4225) Addition of Puppet strings to the ntp module. - Implements beaker module install helper and cleanup spec helper acceptance.rb. - (MODULES-4414) Allow NTP statistics if requested. - (MODULES-4278) Addition of noselect feature. - Addition of 'pool' parameter. - Addition of Ubuntu Xenial Support. #### Bugfixes - Huge readme updates for adding tags to private classes, edits for localization and general cleanups. - (MODULES-3397) Fix of the default Solaris settings. - Changed 'service_ensure' data type to Enum. - (MODULES-3396) remove superfluous empty lines in ntp.conf. - (MODULES-4528) Replace Puppet.version.to_f version comparison from spec helper. - Solaris data that was the wrong way round now fixed. ## Supported Releases 5.0.0 and 6.0.0 ### Summary This double release adds new Puppet 4 features: data in modules, EPP templates, the $facts hash, and data types. The 5.0.0 release is fully backwards compatible to existing Puppet 4 configurations and provides you with [deprecation warnings](https://github.com/puppetlabs/puppetlabs-stdlib#deprecation) for every argument that will not work as expected with the final 6.0.0 release. See the [stdlib docs](https://github.com/puppetlabs/puppetlabs-stdlib#validate_legacy) for an in-depth discussion of this. If you want to learn more about the new features used, have a look at the [NTP: A Puppet 4 language update](https://puppet.com/blog/ntp-puppet-4-language-update) blog post. If you're still running Puppet 3, remain on the latest puppetlabs-ntp 4.x release for now, and see the documentation to [upgrade to Puppet 4](https://docs.puppet.com/puppet/4.6/reference/upgrade_major_pre.html). ### Changes * [Data in modules](https://docs.puppet.com/puppet/latest/reference/lookup_quick_module.html#example-with-hiera): Moves all distribution and OS-dependent defaults into YAML files in `data/`, alleviating the need for a `params` class. Note that while this feature is currently still classed as experimental, the final implementation will support the changes here. * [EPP templating](https://docs.puppet.com/puppet/latest/reference/lang_template_epp.html): Uses the Puppet language as a base for templates to create simpler and safer templates. No need for Ruby anymore! You can pass in EPP templates for the `ntp.conf` and `step-tickers` files using the new `config_epp` and `step_tickers_epp` parameters. * [The $facts hash](https://docs.puppet.com/puppet/latest/reference/lang_facts_and_builtin_vars.html#the-factsfactname-hash): Makes facts visibly distinct from other variables for more readable and maintainable code. This helps eliminate confusion if you use a local variable whose name happens to match that of a common fact. * [Data types for validation](https://docs.puppet.com/puppet/4.6/reference/lang_data.html): Helps you find and replace deprecated code in existing `validate_*` functions with stricter, more readable data type notation. First upgrade to the 5.0.0 release of this module, and address all deprecation warnings before upgrading to the final 6.0.0 release. Please see the [stdlib docs](https://github.com/puppetlabs/puppetlabs-stdlib#validate_legacy) for an in-depth discussion of this process. ## Supported Release 4.2.0 ### Summary A large release with many new features. Multiple additions to parameters and work contributed to OS compatibility. Also includes several bug fixes, including clean ups of code. #### Features - Updated spec helper for more consistency - Addition of config_dir variable - Addition of puppet TOS options - Added support for disabling kernel time discipline in ntp.conf - Update Solaris support for newer Facter, and Amazon for < 1.7.0 facter - Added disable_dhclient parameter - Added OpenSUSE 13.2 compatibility - Parameterize file mode of config file - Enhanced the default configuration - Debian 8 compatibility - Enabled usage of the $ntpsigndsocket parameter - Added parameter for interfaces to ignore - Added support for the authprov parameter - Additional work done for SLES 12 compatibility - Addition of key template options/ key distribution #### Bugfixes - Fix for strict variables and tests - Fixed test with preferred server and iburst enabled - Added logfile parameter test - Cleaned out unused cleanup code and utilities from spec_helper - Deprecated ntp_dirname function - No longer manages the keys_file parent when it would be inappropriate to do so - Converted license string to SPDX format - Removed ruby 1.8.7 and puppet 2.7 from travis-ci jobs ## Supported Release 4.1.2 ###Summary Small release for support of newer PE versions. This increments the version of PE in the metadata.json file. ## Supported Release 4.1.1 ### Summary This is a bugfix release to address security vulnerability CVE-2013-5211. #### Bugfixes - Changes the default behavior to disable monitoring as part of the solution for CVE-2013-5211. ## 2015-07-21 - Supported Release 4.1.0 ### Summary This release updates metadata to support new version of puppet enterprise, as well as new features, bugfixes, and test improvements. #### Features - Adds Solaris 10 support - Adds Fedora 20, 21, 22 compatibility #### Bugfixes - Fix default configuration for Debian (MODULES-2087) - Fix to ensure log file is created before service starts - Fixes SLES params for SLES 10, 11, 12 ## 2015-05-26 - Supported Release 4.0.0 ### Summary This release drops puppet 2.7 support and older stdlib support. It also includes the addition of 12 new properties, as well as numerous bug fixes and other improvements. #### Backwards-incompatible changes - UDLC (Undisciplined local clock) is now no longer enabled by default on anything (previous was enabled on non-virtual). - Puppet 2.7 no longer supported - puppetlabs-stdlib less than 4.5.0 no longer supported #### Features - Readme, Metadata, and Contribution documentation improvements - Acceptance test improvements - Added the `broadcastclient` property - Added the `disable_auth` property - Added `broadcastclient` property - Added `disable_auth` property - Added `fudge` property - Added `peers` property - Added `udlc_stratum` property - Added `tinker` property - Added `minpoll` property - Added `maxpoll` property - Added `stepout` property - Added `leapfile` property #### Bugfixes - Removing equal sign as delimiter in ntp.conf for the logfile parameter. - Add package_manage parameter, which is set to false by default on FreeBSD - Fixed an issue with the `is_virtual` property - Fixed debian wheezy issue - Fix for Redhat to disable ntp restart due to dhcp ntp server updates ##2014-11-04 - Supported Release 3.3.0 ###Summary This release adds support for SLES 12. ####Features - Added support for SLES 12 ##2014-10-02 - Supported Release 3.2.1 ###Summary This is a bug-fix release addressing the security concerns of setting /etc/ntp to mode 0755 recursively. ####Bugfixes - Do not recursively set ownership/mode of /etc/ntp ##2014-09-10 - Supported Release 3.2.0 ###Summary This is primarily a feature release. It adds a few new parameters to class `ntp` and adds support for Solaris 11. ####Features - Add the `$interfaces` parameter to `ntp` - Add support for Solaris 10 and 11 - Synchronized files with modulesync - Test updates - Add the `$iburst_enable` parameter to `ntp` ####Bugfixes - Fixes for strict variables - Remove dependency on stdlib4 ##2014-06-06 - Release 3.1.2 ###Summary This is a supported release. This release fixes a manifest typo. ##2014-06-06 - Release 3.1.1 ###Summary This is a bugfix release to get around dependency issues in PMT 3.6. This version has a dependency on puppetlabs-stdlib >= 4 so PE3.2.x is no longer supported. ####Bugfixes - Remove deprecated Modulefile as it was causing duplicate dependencies with PMT. ##2014-05-14 - Release 3.1.0 ###Summary This release adds `disable_monitor` so you can disable the monitor functionality of NTP, which was recently used in NTP amplification attacks. It also adds support for RHEL7 and Ubuntu 14.04. ####Features - Add `disable_monitor` ####Bugfixes #####Known Bugs * No known bugs ##2014-04-09 - Supported Release 3.0.4 ###Summary This is a supported release. The only functional change in this release is to split up the restrict defaults to be per operating system so that we can provide safer defaults for AIX, to resolve cases where IPv6 are disabled. ####Features - Rework restrict defaults. ####Bugfixes - Fix up a comment. - Fix a test to work better on PE. #####Known Bugs * No known bugs ##2014-03-04 - Supported Release 3.0.3 ###Summary This is a supported release. Correct stdlib compatibility ####Bugfixes - Remove `dirname()` call for correct stdlib compatibility. - Improved tests ####Known Bugs * No known bugs ## 2014-02-13 - Release 3.0.2 ###Summary No functional changes: Update the README and allow custom gem sources. ## 2013-12-17 - Release 3.0.1 ### Summary Work around a packaging bug with symlinks, no other functional changes. ## 2013-12-13 - Release 3.0.0 ### Summary Final release of 3.0, enjoy! ## 2013-10-14 - Version 3.0.0-rc1 ###Summary This release changes the behavior of restrict and adds AIX osfamily support. ####Backwards-incompatible Changes: `restrict` no longer requires you to pass in parameters as: restrict => [ 'restrict x', 'restrict y' ] but just as: restrict => [ 'x', 'y' ] As the template now prefixes each line with restrict. ####Features - Change the behavior of `restrict` so you no longer need the restrict keyword. - Add `udlc` parameter to enable undisciplined local clock regardless of the machines status as a virtual machine. - Add AIX support. ####Fixes - Use class{} instead of including and then anchoring. (style) - Extend Gentoo coverage to Facter 1.7. --- ##2013-09-05 - Version 2.0.1 ###Summary Correct the LICENSE file. ####Bugfixes - Add in the appropriate year and name in LICENSE. ##2013-07-31 - Version 2.0.0 ###Summary The 2.0 release focuses on merging all the distro specific templates into a single reusable template across all platforms. To aid in that goal we now allow you to change the driftfile, ntp keys, and perferred_servers. ####Backwards-incompatible changes As all the distro specific templates have been removed and a unified one created you may be missing functionality you previously relied on. Please test carefully before rolling out globally. Configuration directives that might possibly be affected: - `filegen` - `fudge` (for virtual machines) - `keys` - `logfile` - `restrict` - `restrictkey` - `statistics` - `trustedkey` ####Features: - All templates merged into a single template. - NTP Keys support added. - Add preferred servers support. - Parameters in `ntp` class: - `driftfile`: path for the ntp driftfile. - `keys_enable`: Enable NTP keys feature. - `keys_file`: Path for the NTP keys file. - `keys_trusted`: Which keys to trust. - `keys_controlkey`: Which key to use for the control key. - `keys_requestkey`: Which key to use for the request key. - `preferred_servers`: Array of servers to prefer. - `restrict`: Array of restriction options to apply. --- ###2013-07-15 - Version 1.0.1 ####Bugfixes - Fix deprecated warning in `autoupdate` parameter. - Correctly quote is_virtual fact. ##2013-07-08 - Version 1.0.0 ####Features - Completely refactored to split across several classes. - rspec-puppet tests rewritten to cover more options. - rspec-system tests added. - ArchLinux handled via osfamily instead of special casing. - parameters in `ntp` class: - `autoupdate`: deprecated in favor of directly setting package_ensure. - `panic`: set to false if you wish to allow large clock skews. --- ##2011-11-10 Dan Bode - 0.0.4 * Add Amazon Linux as a supported platform * Add unit tests ##2011-06-16 Jeff McCune - 0.0.3 * Initial release under puppetlabs puppetlabs-ntp-7.1.1/CONTRIBUTING.md0100644005276200011600000002306013207476405013725 0ustar00# Contributing to Puppet modules So you want to contribute to a Puppet module: Great! Below are some instructions to get you started doing that very thing while setting expectations around code quality as well as a few tips for making the process as easy as possible. ### Table of Contents 1. [Getting Started](#getting-started) 1. [Commit Checklist](#commit-checklist) 1. [Submission](#submission) 1. [More about commits](#more-about-commits) 1. [Testing](#testing) - [Running Tests](#running-tests) - [Writing Tests](#writing-tests) 1. [Get Help](#get-help) ## Getting Started - Fork the module repository on GitHub and clone to your workspace - Make your changes! ## Commit Checklist ### The Basics - [x] my commit is a single logical unit of work - [x] I have checked for unnecessary whitespace with "git diff --check" - [x] my commit does not include commented out code or unneeded files ### The Content - [x] my commit includes tests for the bug I fixed or feature I added - [x] my commit includes appropriate documentation changes if it is introducing a new feature or changing existing functionality - [x] my code passes existing test suites ### The Commit Message - [x] the first line of my commit message includes: - [x] an issue number (if applicable), e.g. "(MODULES-xxxx) This is the first line" - [x] a short description (50 characters is the soft limit, excluding ticket number(s)) - [x] the body of my commit message: - [x] is meaningful - [x] uses the imperative, present tense: "change", not "changed" or "changes" - [x] includes motivation for the change, and contrasts its implementation with the previous behavior ## Submission ### Pre-requisites - Make sure you have a [GitHub account](https://github.com/join) - [Create a ticket](https://tickets.puppet.com/secure/CreateIssue!default.jspa), or [watch the ticket](https://tickets.puppet.com/browse/) you are patching for. ### Push and PR - Push your changes to your fork - [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) against the repository in the puppetlabs organization ## More about commits 1. Make separate commits for logically separate changes. Please break your commits down into logically consistent units which include new or changed tests relevant to the rest of the change. The goal of doing this is to make the diff easier to read for whoever is reviewing your code. In general, the easier your diff is to read, the more likely someone will be happy to review it and get it into the code base. If you are going to refactor a piece of code, please do so as a separate commit from your feature or bug fix changes. We also really appreciate changes that include tests to make sure the bug is not re-introduced, and that the feature is not accidentally broken. Describe the technical detail of the change(s). If your description starts to get too long, that is a good sign that you probably need to split up your commit into more finely grained pieces. Commits which plainly describe the things which help reviewers check the patch and future developers understand the code are much more likely to be merged in with a minimum of bike-shedding or requested changes. Ideally, the commit message would include information, and be in a form suitable for inclusion in the release notes for the version of Puppet that includes them. Please also check that you are not introducing any trailing whitespace or other "whitespace errors". You can do this by running "git diff --check" on your changes before you commit. 2. Sending your patches To submit your changes via a GitHub pull request, we _highly_ recommend that you have them on a topic branch, instead of directly on "master". It makes things much easier to keep track of, especially if you decide to work on another thing before your first change is merged in. GitHub has some pretty good [general documentation](http://help.github.com/) on using their site. They also have documentation on [creating pull requests](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). In general, after pushing your topic branch up to your repository on GitHub, you can switch to the branch in the GitHub UI and click "Pull Request" towards the top of the page in order to open a pull request. 3. Update the related JIRA issue. If there is a JIRA issue associated with the change you submitted, then you should update the ticket to include the location of your branch, along with any other commentary you may wish to make. # Testing ## Getting Started Our Puppet modules provide [`Gemfile`](./Gemfile)s, which can tell a Ruby package manager such as [bundler](http://bundler.io/) what Ruby packages, or Gems, are required to build, develop, and test this software. Please make sure you have [bundler installed](http://bundler.io/#getting-started) on your system, and then use it to install all dependencies needed for this project in the project root by running ```shell % bundle install --path .bundle/gems Fetching gem metadata from https://rubygems.org/........ Fetching gem metadata from https://rubygems.org/.. Using rake (10.1.0) Using builder (3.2.2) -- 8><-- many more --><8 -- Using rspec-system-puppet (2.2.0) Using serverspec (0.6.3) Using rspec-system-serverspec (1.0.0) Using bundler (1.3.5) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. ``` NOTE: some systems may require you to run this command with sudo. If you already have those gems installed, make sure they are up-to-date: ```shell % bundle update ``` ## Running Tests With all dependencies in place and up-to-date, run the tests: ### Unit Tests ```shell % bundle exec rake spec ``` This executes all the [rspec tests](http://rspec-puppet.com/) in the directories defined [here](https://github.com/puppetlabs/puppetlabs_spec_helper/blob/699d9fbca1d2489bff1736bb254bb7b7edb32c74/lib/puppetlabs_spec_helper/rake_tasks.rb#L17) and so on. rspec tests may have the same kind of dependencies as the module they are testing. Although the module defines these dependencies in its [metadata.json](./metadata.json), rspec tests define them in [.fixtures.yml](./fixtures.yml). ### Acceptance Tests Some Puppet modules also come with acceptance tests, which use [beaker][]. These tests spin up a virtual machine under [VirtualBox](https://www.virtualbox.org/), controlled with [Vagrant](http://www.vagrantup.com/), to simulate scripted test scenarios. In order to run these, you need both Virtualbox and Vagrant installed on your system. Run the tests by issuing the following command ```shell % bundle exec rake spec_clean % bundle exec rspec spec/acceptance ``` This will now download a pre-fabricated image configured in the [default node-set](./spec/acceptance/nodesets/default.yml), install Puppet, copy this module, and install its dependencies per [spec/spec_helper_acceptance.rb](./spec/spec_helper_acceptance.rb) and then run all the tests under [spec/acceptance](./spec/acceptance). ## Writing Tests ### Unit Tests When writing unit tests for Puppet, [rspec-puppet][] is your best friend. It provides tons of helper methods for testing your manifests against a catalog (e.g. contain_file, contain_package, with_params, etc). It would be ridiculous to try and top rspec-puppet's [documentation][rspec-puppet_docs] but here's a tiny sample: Sample manifest: ```puppet file { "a test file": ensure => present, path => "/etc/sample", } ``` Sample test: ```ruby it 'does a thing' do expect(subject).to contain_file("a test file").with({:path => "/etc/sample"}) end ``` ### Acceptance Tests Writing acceptance tests for Puppet involves [beaker][] and its cousin [beaker-rspec][]. A common pattern for acceptance tests is to create a test manifest, apply it twice to check for idempotency or errors, then run expectations. ```ruby it 'does an end-to-end thing' do pp = <<-EOF file { 'a test file': ensure => present, path => "/etc/sample", content => "test string", } apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end describe file("/etc/sample") do it { is_expected.to contain "test string" } end ``` # If you have commit access to the repository Even if you have commit access to the repository, you still need to go through the process above, and have someone else review and merge in your changes. The rule is that **all changes must be reviewed by a project developer that did not write the code to ensure that all changes go through a code review process.** The record of someone performing the merge is the record that they performed the code review. Again, this should be someone other than the author of the topic branch. # Get Help ### On the web * [Puppet help messageboard](http://puppet.com/community/get-help) * [Writing tests](https://docs.puppet.com/guides/module_guides/bgtm.html#step-three-module-testing) * [General GitHub documentation](http://help.github.com/) * [GitHub pull request documentation](http://help.github.com/send-pull-requests/) ### On chat * Slack (slack.puppet.com) #forge-modules, #puppet-dev, #windows, #voxpupuli * IRC (freenode) #puppet-dev, #voxpupuli [rspec-puppet]: http://rspec-puppet.com/ [rspec-puppet_docs]: http://rspec-puppet.com/documentation/ [beaker]: https://github.com/puppetlabs/beaker [beaker-rspec]: https://github.com/puppetlabs/beaker-rspec puppetlabs-ntp-7.1.1/Gemfile0100644005276200011600000001350413232340314012754 0ustar00source ENV['GEM_SOURCE'] || 'https://rubygems.org' def location_for(place_or_version, fake_version = nil) if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)} [fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact elsif place_or_version =~ %r{\Afile:\/\/(.*)} ['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }] else [place_or_version, { require: false }] end end def gem_type(place_or_version) if place_or_version =~ %r{\Agit[:@]} :git elsif !place_or_version.nil? && place_or_version.start_with?('file:') :file else :gem end end ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments minor_version = ruby_version_segments[0..1].join('.') group :development do gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0') gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9') gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby] gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby] gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-blacksmith", '~> 3.4', require: false end group :system_tests do gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby] gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13') gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1') gem "beaker-pe", require: false gem "beaker-hostgenerator" gem "beaker-rspec" end puppet_version = ENV['PUPPET_GEM_VERSION'] puppet_type = gem_type(puppet_version) facter_version = ENV['FACTER_GEM_VERSION'] hiera_version = ENV['HIERA_GEM_VERSION'] def puppet_older_than?(version) puppet_version = ENV['PUPPET_GEM_VERSION'] !puppet_version.nil? && Gem::Version.correct?(puppet_version) && Gem::Requirement.new("< #{version}").satisfied_by?(Gem::Version.new(puppet_version.dup)) end gems = {} gems['puppet'] = location_for(puppet_version) # If facter or hiera versions have been specified via the environment # variables, use those versions. If not, and if the puppet version is < 3.5.0, # use known good versions of both for puppet < 3.5.0. if facter_version gems['facter'] = location_for(facter_version) elsif puppet_type == :gem && puppet_older_than?('3.5.0') gems['facter'] = ['>= 1.6.11', '<= 1.7.5', require: false] end if hiera_version gems['hiera'] = location_for(ENV['HIERA_GEM_VERSION']) elsif puppet_type == :gem && puppet_older_than?('3.5.0') gems['hiera'] = ['>= 1.0.0', '<= 1.3.0', require: false] end if Gem.win_platform? && (puppet_type != :gem || puppet_older_than?('3.5.0')) # For Puppet gems < 3.5.0 (tested as far back as 3.0.0) on Windows if puppet_type == :gem gems['ffi'] = ['1.9.0', require: false] gems['minitar'] = ['0.5.4', require: false] gems['win32-eventlog'] = ['0.5.3', '<= 0.6.5', require: false] gems['win32-process'] = ['0.6.5', '<= 0.7.5', require: false] gems['win32-security'] = ['~> 0.1.2', '<= 0.2.5', require: false] gems['win32-service'] = ['0.7.2', '<= 0.8.8', require: false] else gems['ffi'] = ['~> 1.9.0', require: false] gems['minitar'] = ['~> 0.5.4', require: false] gems['win32-eventlog'] = ['~> 0.5', '<= 0.6.5', require: false] gems['win32-process'] = ['~> 0.6', '<= 0.7.5', require: false] gems['win32-security'] = ['~> 0.1', '<= 0.2.5', require: false] gems['win32-service'] = ['~> 0.7', '<= 0.8.8', require: false] end gems['win32-dir'] = ['~> 0.3', '<= 0.4.9', require: false] if RUBY_VERSION.start_with?('1.') gems['win32console'] = ['1.3.2', require: false] # sys-admin was removed in Puppet 3.7.0 and doesn't compile under Ruby 2.x gems['sys-admin'] = ['1.5.6', require: false] end # Puppet < 3.7.0 requires these. # Puppet >= 3.5.0 gem includes these as requirements. # The following versions are tested to work with 3.0.0 <= puppet < 3.7.0. gems['win32-api'] = ['1.4.8', require: false] gems['win32-taskscheduler'] = ['0.2.2', require: false] gems['windows-api'] = ['0.4.3', require: false] gems['windows-pr'] = ['1.2.3', require: false] elsif Gem.win_platform? # If we're using a Puppet gem on Windows which handles its own win32-xxx gem # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445). gems['win32-dir'] = ['<= 0.4.9', require: false] gems['win32-eventlog'] = ['<= 0.6.5', require: false] gems['win32-process'] = ['<= 0.7.5', require: false] gems['win32-security'] = ['<= 0.2.5', require: false] gems['win32-service'] = ['<= 0.8.8', require: false] end gems.each do |gem_name, gem_params| gem gem_name, *gem_params end # Evaluate Gemfile.local and ~/.gemfile if they exist extra_gemfiles = [ "#{__FILE__}.local", File.join(Dir.home, '.gemfile'), ] extra_gemfiles.each do |gemfile| if File.file?(gemfile) && File.readable?(gemfile) eval(File.read(gemfile), binding) end end # vim: syntax=ruby puppetlabs-ntp-7.1.1/LICENSE0100644005276200011600000002613613207476405012510 0ustar00 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. puppetlabs-ntp-7.1.1/MAINTAINERS.md0100644005276200011600000000027313207476405013571 0ustar00## Maintenance Maintainers: - Puppet Forge Modules Team `forge-modules |at| puppet |dot| com` Tickets: https://tickets.puppet.com/browse/MODULES. Make sure to set component to `ntp`. puppetlabs-ntp-7.1.1/NOTICE0100644005276200011600000000111013232340314012353 0ustar00Puppet Module - puppetlabs-ntp Copyright 2018 Puppet, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.puppetlabs-ntp-7.1.1/README.md0100644005276200011600000003222213232340314012736 0ustar00# ntp #### Table of Contents 1. [Module Description - What the module does and why it is useful](#module-description) 1. [Setup - The basics of getting started with ntp](#setup) 1. [Usage - Configuration options and additional functionality](#usage) 1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) 1. [Limitations - OS compatibility, etc.](#limitations) 1. [Development - Guide for contributing to the module](#development) ## Module description The ntp module installs, configures, and manages the NTP service across a range of operating systems and distributions. ## Setup ### Beginning with ntp `include ntp` is enough to get you up and running. To pass in parameters specifying which servers to use: ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], } ``` ## Usage All parameters for the ntp module are contained within the main `ntp` class, so for any function of the module, set the options you want. See the common usages below for examples. ### Install and enable NTP ```puppet include ntp ``` ### Change NTP servers ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], } ``` ### Restrict who can connect ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], restrict => ['127.0.0.1'], } ``` ### Install a client that can't be queried ```puppet class { 'ntp': servers => ['ntp1.corp.com', 'ntp2.corp.com'], restrict => [ 'default ignore', '-6 default ignore', '127.0.0.1', '-6 ::1', 'ntp1.corp.com nomodify notrap nopeer noquery', 'ntp2.corp.com nomodify notrap nopeer noquery' ], } ``` ### Listen on specific interfaces Restricting NTP to a specific interface is especially useful on Openstack node, which may have numerous virtual interfaces. ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], interfaces => ['127.0.0.1', '1.2.3.4'] } ``` ### Opt out of Puppet controlling the service ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], restrict => ['127.0.0.1'], service_manage => false, } ``` ### Configure and run ntp without installing ```puppet class { 'ntp': package_manage => false, } ``` ### Pass in a custom template ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], restrict => ['127.0.0.1'], service_manage => false, config_epp => 'different/module/custom.template.epp', } ``` ## Reference ### Classes #### Public classes * ntp: Main class, includes all other classes. #### Private classes * ntp::install: Handles the packages. * ntp::config: Handles the configuration file. * ntp::service: Handles the service. ### Parameters The following parameters are available in the `ntp` class: #### `authprov` Optional. Data type: String. Enables compatibility with W32Time in some versions of NTPd, such as Novell DSfW. Default value: `undef`. #### `broadcastclient` Data type: Boolean. Enables reception of broadcast server messages to any local interface. Default value: `false`. #### `config` Data type: Stdlib::Absolutepath. Specifies a file for NTP's configuration info. Default value: '/etc/ntp.conf' (Solaris: '/etc/inet/ntp.conf'). #### `config_dir` Optional. Data type: Stdlib::Absolutepath. Specifies a directory for the NTP configuration files. Default value: `undef`. #### `config_epp` Optional. Data type: String. Specifies an absolute or relative file path to an EPP template for the config file. Example value: 'ntp/ntp.conf.epp'. A validation error is thrown if both this **and** the `config_template` parameter are specified. #### `config_file_mode` Data type: String. Specifies a file mode for the ntp configuration file. Default value: '0664'. #### `config_template` Optional. Data type: String. Specifies an absolute or relative file path to an ERB template for the config file. Example value: 'ntp/ntp.conf.erb'. A validation error is thrown if both this **and** the `config_epp` parameter are specified. #### `disable_auth` Data type: Boolean. Disables cryptographic authentication for broadcast client, multicast client, and symmetric passive associations. #### `disable_dhclient` Data type: Boolean. Disables `ntp-servers` in `dhclient.conf` to prevent Dhclient from managing the NTP configuration. #### `disable_kernel` Data type: Boolean. Disables kernel time discipline. #### `disable_monitor` Data type: Boolean. Disables the monitoring facility in NTP. Default value: `true`. #### `driftfile` Data type: Stdlib::Absolutepath. Specifies the location of the NTP driftfile. Default value: '/var/lib/ntp/drift' (AIX: 'ntp::driftfile:', Solaris: '/var/ntp/ntp.drift'). #### `enable_mode7` Data type: Boolean. Enables processing of NTP mode 7 implementation-specific requests which are used by the deprecated ntpdc program. Default value: `false`. #### `fudge` Optional. Data type: Array[String]. Provides additional information for individual clock drivers. Default value: [ ]. #### `iburst_enable` Data type: Boolean. Specifies whether to enable the iburst option for every NTP peer. Default value: `false` (AIX, Debian: `true`). #### `interfaces` Data type: Array[String]. Specifies one or more network interfaces for NTP to listen on. Default value: [ ]. #### `interfaces_ignore` Data type: Array[String]. Specifies one or more ignore pattern for the NTP listener configuration (for example: all, wildcard, ipv6). Default value: [ ]. #### `keys` Data type: Array[String]. Distributes keys to keys file. Default value: [ ]. #### `keys_controlkey` Optional. Data type: Ntp::Key_id. Specifies the key identifier to use with the ntpq utility. Value in the range of 1 to 65,534 inclusive. Default value: ' '. #### `keys_enable` Data type: Boolean. Whether to enable key-based authentication. Default value: `false`. #### `keys_file` Stdlib::Absolutepath. Specifies the complete path and location of the MD5 key file containing the keys and key identifiers used by ntpd, ntpq and ntpdc when operating with symmetric key cryptography. Default value: '/etc/ntp.keys' (RedHat, Amazon: `/etc/ntp/keys`). #### `keys_requestkey` Optional. Data type: Ntp::Key_id. Specifies the key identifier to use with the ntpdc utility program. Value in the range of 1 to 65,534 inclusive. Default value: ' '. #### `keys_trusted` Optional. Data type: Array[Ntp::Key_id]. Provides one or more keys to be trusted by NTP. Default value: [ ]. #### `leapfile` Optional. Data type: Stdlib::Absolutepath. Specifies a leap second file for NTP to use. Default value: ' '. #### `logfile` Optional. Data type: Stdlib::Absolutepath. Specifies a log file for NTP to use instead of syslog. Default value: ' '. #### `minpoll` Optional. Data type: Ntp::Poll_interval. Sets Puppet to non-standard minimal poll interval of upstream servers. Values: 4 to 17. Default: `undef`. #### `maxpoll` Optional. Data type: Ntp::Poll_interval. Sets use non-standard maximal poll interval of upstream servers. Values: 4 to 17. Default option: `undef`(FreeBSD: 9). #### `ntpsigndsocket` Optional. Data type: Stdlib::Absolutepath. Sets NTP to sign packets using the socket in the ntpsigndsocket path. Requires NTP to be configured to sign sockets. Value: Path to the socket directory; for example, for Samba: `usr/local/samba/var/lib/ntp_signd/`. Default value: `undef`. #### `package_ensure` Data type: String. Whether to install the NTP package, and what version to install. Values: 'present', 'latest', or a specific version number. Default value: 'present'. #### `package_manage` Data type: Boolean. Whether to manage the NTP package. Default value: `true`. #### `package_name` Data type: Array[String]. Specifies the NTP package to manage. Default value: ['ntp'] (AIX: 'bos.net.tcp.client', Solaris: [ 'SUNWntp4r', 'SUNWntp4u' ]). #### `panic` Optional. Data type: Integer[0]. Whether NTP should panic and exit in the event of a very large clock skew. Applies only if `tinker` option set to `true` or if your environment is in a virtual machine. Default value: `undef` (virtual environments: 0). #### `pool` Optional. Data type: Array[String]. List of NTP server pools with which to synchronise the local clock. Default value: [ ]. #### `peers` Data type: Array[String]. List of NTP servers with which to synchronise the local clock. #### `preferred_servers` Data type: Array[String]. Specifies one or more preferred peers. Puppet appends 'prefer' to each matching item in the `servers` array. Default value: [ ]. #### `noselect_servers` Array[String] Specifies one or more peers to not sync with. Puppet appends 'noselect' to each matching item in the `servers` array. Default value: [ ]. #### `restrict` Data type: Array[String]. Specifies one or more `restrict` options for the NTP configuration. Puppet prefixes each item with 'restrict', so you need to list only the content of the restriction. Default value for most operating systems: ```shell [ 'default kod nomodify notrap nopeer noquery', '-6 default kod nomodify notrap nopeer noquery', '127.0.0.1', '-6 ::1', ] ``` Default value for AIX systems: ```shell [ 'default nomodify notrap nopeer noquery', '127.0.0.1', ] ``` #### `servers` Data type: Array[String]. Specifies one or more servers to be used as NTP peers. Default value: varies by operating system. #### `service_enable` Data type: Boolean. Whether to enable the NTP service at boot. Default value: `true`. #### `service_ensure` Data type: Enum['running', 'stopped']. Whether the NTP service should be running. Default value: 'running'. #### `service_manage` Data type: Boolean. Whether to manage the NTP service. Default value: `true`. #### `service_name` Data type: String. The NTP service to manage. Default value: varies by operating system. #### `service_provider` Data type: String. Which service provider to use for NTP. Default value: `undef`. #### `slewalways` Data type: Enum['no','yes']. Whether to set `xntpd` to disable stepping behavior and always slew (gradually adjust) the clock. Applies only to platforms that run `xntpd`, such as AIX. Do not specify this setting on other platforms. Default value: varies by operating system. #### `statistics` Data type: Array. List of statistics to gather if ntp monitoring is enabled. Default value: []. #### `statsdir` Data type: Stdlib::Absolutepath. Location to store NTP statistics if ntp monitoring is enabled. Default value: '/var/log/ntpstats'. #### `step_tickers_file` Optional. Data type: Stdlib::Absolutepath. Location of the step tickers file on the managed system. Default value: varies by operating system. #### `step_tickers_epp` Optional. Data type: String. Location of the step tickers EPP template file. Validation error is thrown if both this and the `step_tickers_template` parameters are specified. Default value: varies by operating system. #### `step_tickers_template` Optional. Data type: String. Location of the step tickers ERB template file. Validation error is thrown if both this and the `step_tickers_epp` parameter are specified. Default value: varies by operating system. #### `stepout` Optional. Data type: Integer[0, 65535]. Value for stepout if `tinker` value is `true`. Valid options: unsigned shortint digit. Default value: `undef`. #### `tos` Data type: Boolean. Whether to enable tos options. Default value: `false`. #### `tos_maxclock` Optional. Data type: Integer[1]. Specifies the maxclock tos option. Default value: 6. #### `tos_minclock` Optional. Data type: Integer[1]. Specifies the minclock tos option. Default value: 3. #### `tos_minsane` Optional. Data type: Integer[1]. Specifies the minsane tos option. Default value: 1. #### `tos_floor` Optional. Data type: Integer[1]. Specifies the floor tos option. Default value: 1. #### `tos_ceiling` Optional. Data type: Integer[1]. Specifies the ceiling tos option. Default value: 15. #### `tos_cohort` Data type: Variant. Boolean, Integer[0,1]. Specifies the cohort tos option. Valid options: 0 or 1. Default value: 0. #### `tinker` Data type: Boolean. Whether to enable tinker options. Default value: `false`. #### `udlc` Data type: Boolean. Specifies whether to configure NTP to use the undisciplined local clock as a time source. Default value: `false`. #### `udlc_stratum` Optional. Data type: Integer[1,15]. Specifies the stratum the server should operate at when using the undisciplined local clock as the time source. This value should be set to no less than 10 if ntpd might be accessible outside your immediate, controlled network. Default value: 10. ## Limitations This module has been tested on [all PE-supported platforms](https://forge.puppetlabs.com/supported#compat-matrix). Additionally, it is tested (but not supported) on Solaris 10 and Fedora 20-22. ## Development Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. Please follow our guidelines when contributing changes. For more information, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html) ### Contributors To see who's already involved, see the [list of contributors.](https://github.com/puppetlabs/puppetlabs-ntp/graphs/contributors) puppetlabs-ntp-7.1.1/Rakefile0100644005276200011600000000017713232340314013130 0ustar00require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' require 'puppet_blacksmith/rake_tasks' puppetlabs-ntp-7.1.1/checksums.json0100644005276200011600000001027013237313253014345 0ustar00{ "CHANGELOG.md": "9c089ebe50404239a6f52d32245bc273", "CONTRIBUTING.md": "4d17f3c942e7c93d1577cc4438a231e4", "Gemfile": "47f2bb73e730d42a921e7bca4449f5aa", "LICENSE": "3b83ef96387f14655fc854ddc3c6bd57", "MAINTAINERS.md": "9230f8b03e0d9dbb08812838574be9d3", "NOTICE": "c9a9561a16eac9f7304d12680d9df29f", "README.md": "144e8701ef9da17267525340e6bd6cec", "Rakefile": "df4172642435e770c27019d9d15d59bd", "data/AIX-family.yaml": "9ebab7ca637c380fa75e7dff0a694795", "data/Amazon.yaml": "592c462c2449a2aa36067b32a5c9b559", "data/Archlinux-family.yaml": "37df45c9174facb6699d68db292098a6", "data/Debian-family.yaml": "9c482d7062f1dd2e073b510d25ea07d9", "data/Fedora.yaml": "7e28c6fea7fe7e41b39bfbb8952138f9", "data/FreeBSD-family.yaml": "a8f4dc99823ca81a2c408b9316184468", "data/Gentoo-family.yaml": "4cbfa6ca120ea1861270d523d97018a1", "data/OpenSuSE.yaml": "0df8a5b62510ce8a86d2040f238b5f76", "data/RedHat-family.yaml": "37faf7710394c7f26bfd3c2cce35871a", "data/SLES-10.yaml": "b1ffac58b18589235bbb546dda98380f", "data/SLES-12.yaml": "0df8a5b62510ce8a86d2040f238b5f76", "data/Solaris-10.yaml": "5fd9c7acbb4b4d4ad337f310d13734f9", "data/Solaris-11.yaml": "c314fbdb06a00722974146b10dc8ba00", "data/Suse-family.yaml": "b9ddb837225182db53d04b8f3aae2703", "data/common.yaml": "71f89ac0948987cfaae150b775b163bb", "examples/init.pp": "d398e7687ec1d893ef23d1b7d2afc094", "hiera.yaml": "992040941dac878c116c0e02a3ed757e", "locales/config.yaml": "69304e9cce562aa59bd7bd4ddcb91b8b", "locales/ja/puppetlabs-ntp.po": "7265ff57e178feb7a65835f7cf271e2c", "locales/puppetlabs-ntp.pot": "7d6e724b81413279c5980f12c49c47d2", "manifests/config.pp": "8b56289f49c6cd45f2bb90afcbdcd68f", "manifests/init.pp": "e199457f40959d2808809f850b08a27c", "manifests/install.pp": "53fe7977d5f1b8c19e1ea357da9f1b32", "manifests/service.pp": "27f8f60da5778f791fbff66765b97387", "metadata.json": "e8a9de6fd9af1c80ac6a915426d31dae", "readmes/README_ja_JP.md": "7e6c28fcf29c5a2c170d289edca7f853", "spec/acceptance/class_spec.rb": "5db9f816c7eb14359a5ecce4f791d45e", "spec/acceptance/disable_monitoring_spec.rb": "38f0e4d832bb07d112ad70ba48abbcca", "spec/acceptance/enable_mode7_spec.rb": "a613df0ef09716afbef85fb526d89783", "spec/acceptance/nodesets/centos-7-x64.yml": "a713f3abd3657f0ae2878829badd23cd", "spec/acceptance/nodesets/debian-8-x64.yml": "d2d2977900989f30086ad251a14a1f39", "spec/acceptance/nodesets/default.yml": "b42da5a1ea0c964567ba7495574b8808", "spec/acceptance/nodesets/docker/centos-7.yml": "8a3892807bdd62306ae4774f41ba11ae", "spec/acceptance/nodesets/docker/debian-8.yml": "ac8e871d1068c96de5e85a89daaec6df", "spec/acceptance/nodesets/docker/ubuntu-14.04.yml": "dc42ee922a96908d85b8f0f08203ce58", "spec/acceptance/noselect_servers_spec.rb": "b7a52952c9fc8e70360fa0654cda62a8", "spec/acceptance/ntp_config_spec.rb": "1d9c0d54f3c0005fcb827fa4f62dd38f", "spec/acceptance/ntp_install_spec.rb": "ee19f977f546cc91f9ddeee4bbf89218", "spec/acceptance/ntp_parameters_spec.rb": "75ef88bb4465b36e032a0a3b57e1ca79", "spec/acceptance/ntp_service_spec.rb": "3c0b28b1afd118d4a0c05ae9be430e06", "spec/acceptance/preferred_servers_spec.rb": "11c96baae75081f7ab351cf97bc61076", "spec/acceptance/restrict_spec.rb": "2b2adcc0d1e7fd6c8a6e4e55725858aa", "spec/acceptance/statistics_spec.rb": "af3496dc800cf03708ac218f99ac4d83", "spec/acceptance/unsupported_spec.rb": "b7bd7e7696d9234f418e2a2a01523631", "spec/classes/contains_spec.rb": "0f5ae07bd2457f334f0194f4636dc8eb", "spec/classes/ntp_spec.rb": "46260b5c2cbeb46038daaa315f3c9760", "spec/fixtures/my_ntp/templates/ntp.conf.epp": "21cd1ad2ded293bd0411e3f1654ebf91", "spec/fixtures/my_ntp/templates/ntp.conf.erb": "a123f4613d4c8f1945139f3307c1bc69", "spec/spec_helper.rb": "182136c8450f0af179fa0705ce971587", "spec/spec_helper_acceptance.rb": "8c0ee02b186eda9250ab4c828a4f8b4a", "spec/spec_helper_local.rb": "35d201e4b56adf60407d84c2a231b9ff", "templates/keys.epp": "4931f55f1669138166cadd70b931ddca", "templates/ntp.conf.epp": "d892f9dfd38fa234505373df7e085a02", "templates/step-tickers.epp": "1a20cfd4c636ce4f696b23419d6c9ace", "types/key_id.pp": "e01c91e0839c5684495a8ea70f2399e5", "types/poll_interval.pp": "6a2190db7dcfbf3a7be0f659b6fd287d" }puppetlabs-ntp-7.1.1/data0040755005276200011600000000000013237313253012322 5ustar00puppetlabs-ntp-7.1.1/data/AIX-family.yaml0100644005276200011600000000031613232340314015153 0ustar00--- ntp::driftfile: '/etc/ntp.drift' ntp::package_name: - 'bos.net.tcp.client' ntp::restrict: - 'default nomodify notrap nopeer noquery' - '127.0.0.1' ntp::service_name: 'xntpd' ntp::slewalways: 'no' puppetlabs-ntp-7.1.1/data/Amazon.yaml0100644005276200011600000000051113207476405014512 0ustar00ntp::keys_file: '/etc/ntp/keys' ntp::restrict: - 'default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '-6 ::1' ntp::iburst_enable: false ntp::servers: - '0.centos.pool.ntp.org' - '1.centos.pool.ntp.org' - '2.centos.pool.ntp.org' ntp::disable_monitor: false puppetlabs-ntp-7.1.1/data/Archlinux-family.yaml0100644005276200011600000000051213232340314016465 0ustar00ntp::driftfile: '/var/lib/ntp/ntp.drift' ntp::restrict: - 'default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '-6 ::1' ntp::iburst_enable: false ntp::servers: - '0.arch.pool.ntp.org' - '1.arch.pool.ntp.org' - '2.arch.pool.ntp.org' - '3.arch.pool.ntp.org' puppetlabs-ntp-7.1.1/data/Debian-family.yaml0100644005276200011600000000045013232340314015713 0ustar00ntp::restrict: - '-4 default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '::1' ntp::service_name: 'ntp' ntp::servers: - '0.debian.pool.ntp.org' - '1.debian.pool.ntp.org' - '2.debian.pool.ntp.org' - '3.debian.pool.ntp.org' puppetlabs-ntp-7.1.1/data/Fedora.yaml0100644005276200011600000000032413207476405014467 0ustar00ntp::restrict: - 'default nomodify notrap nopeer noquery' - '127.0.0.1' - '::1' ntp::servers: - '0.fedora.pool.ntp.org' - '1.fedora.pool.ntp.org' - '2.fedora.pool.ntp.org' - '3.fedora.pool.ntp.org' puppetlabs-ntp-7.1.1/data/FreeBSD-family.yaml0100644005276200011600000000060213232340314015742 0ustar00ntp::driftfile: '/var/db/ntpd.drift' ntp::package_name: ['net/ntp'] ntp::restrict: - 'default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '-6 ::1' ntp::servers: - '0.freebsd.pool.ntp.org' - '1.freebsd.pool.ntp.org' - '2.freebsd.pool.ntp.org' - '3.freebsd.pool.ntp.org' ntp::maxpoll: 9 ntp::package_manage: false puppetlabs-ntp-7.1.1/data/Gentoo-family.yaml0100644005276200011600000000051713232340314015770 0ustar00ntp::package_name: [ 'net-misc/ntp' ] ntp::restrict: - 'default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '-6 ::1' ntp::iburst_enable: false ntp::servers: - '0.gentoo.pool.ntp.org' - '1.gentoo.pool.ntp.org' - '2.gentoo.pool.ntp.org' - '3.gentoo.pool.ntp.org' puppetlabs-ntp-7.1.1/data/OpenSuSE.yaml0100644005276200011600000000006713207476405014734 0ustar00ntp::service_name: ntpd ntp::service_provider: systemd puppetlabs-ntp-7.1.1/data/RedHat-family.yaml0100644005276200011600000000053513232340314015704 0ustar00ntp::keys_file: '/etc/ntp/keys' ntp::restrict: - 'default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '-6 ::1' ntp::iburst_enable: false ntp::servers: - '0.centos.pool.ntp.org' - '1.centos.pool.ntp.org' - '2.centos.pool.ntp.org' ntp::step_tickers_file: '/etc/ntp/step-tickers' puppetlabs-ntp-7.1.1/data/SLES-10.yaml0100644005276200011600000000003613207476405014253 0ustar00ntp::package_name: [ 'xntp' ] puppetlabs-ntp-7.1.1/data/SLES-12.yaml0100644005276200011600000000006713207476405014261 0ustar00ntp::service_name: ntpd ntp::service_provider: systemd puppetlabs-ntp-7.1.1/data/Solaris-10.yaml0100644005276200011600000000044413207476405015124 0ustar00ntp::config: '/etc/inet/ntp.conf' ntp::driftfile: '/var/ntp/ntp.drift' ntp::keys_file: '/etc/inet/ntp.keys' ntp::package_name: [ 'SUNWntp4r', 'SUNWntp4u' ] ntp::restrict: - 'default nomodify notrap nopeer noquery' - '127.0.0.1' ntp::service_name: 'network/ntp4' ntp::iburst_enable: false puppetlabs-ntp-7.1.1/data/Solaris-11.yaml0100644005276200011600000000054513207476405015127 0ustar00ntp::config: '/etc/inet/ntp.conf' ntp::driftfile: '/var/ntp/ntp.drift' ntp::keys_file: '/etc/inet/ntp.keys' ntp::package_name: [ 'service/network/ntp' ] ntp::restrict: - 'default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '-6 ::1' ntp::service_name: 'network/ntp' ntp::iburst_enable: false puppetlabs-ntp-7.1.1/data/Suse-family.yaml0100644005276200011600000000053513232340314015454 0ustar00ntp::service_name: ntp ntp::driftfile: '/var/lib/ntp/drift/ntp.drift' ntp::restrict: - 'default kod nomodify notrap nopeer noquery' - '-6 default kod nomodify notrap nopeer noquery' - '127.0.0.1' - '-6 ::1' ntp::servers: - '0.opensuse.pool.ntp.org' - '1.opensuse.pool.ntp.org' - '2.opensuse.pool.ntp.org' - '3.opensuse.pool.ntp.org' puppetlabs-ntp-7.1.1/data/common.yaml0100644005276200011600000000262013232340314014543 0ustar00--- ntp::authprov: ~ ntp::broadcastclient: false ntp::config_dir: ~ ntp::config_file_mode: '0644' ntp::config: '/etc/ntp.conf' ntp::config_template: ~ ntp::config_epp: ~ ntp::disable_auth: false ntp::disable_dhclient: false ntp::disable_kernel: false ntp::disable_monitor: true ntp::driftfile: '/var/lib/ntp/drift' ntp::enable_mode7: false ntp::fudge: [] ntp::iburst_enable: true ntp::interfaces_ignore: [] ntp::interfaces: [] ntp::keys_controlkey: ~ ntp::keys_enable: false ntp::keys_file: '/etc/ntp.keys' ntp::keys_requestkey: ~ ntp::keys_trusted: [] ntp::keys: [] ntp::leapfile: ~ ntp::logfile: ~ ntp::ntpsigndsocket: ~ ntp::maxpoll: ~ ntp::minpoll: ~ ntp::package_ensure: present ntp::package_manage: true ntp::package_name: [ 'ntp' ] ntp::panic: ~ ntp::peers: [] ntp::pool: [] ntp::preferred_servers: [] ntp::noselect_servers: [] ntp::servers: - '0.pool.ntp.org' - '1.pool.ntp.org' - '2.pool.ntp.org' - '3.pool.ntp.org' ntp::service_enable: true ntp::service_ensure: running ntp::service_manage: true ntp::service_name: ntpd ntp::service_provider: ~ ntp::slewalways: ~ ntp::statistics: [] ntp::statsdir: '/var/log/ntpstats' ntp::stepout: ~ ntp::step_tickers_file: ~ ntp::step_tickers_template: ~ ntp::step_tickers_epp: ~ ntp::tinker: ~ ntp::tos_ceiling: 15 ntp::tos_cohort: 0 ntp::tos_floor: 1 ntp::tos_maxclock: 6 ntp::tos_minclock: 3 ntp::tos_minsane: 1 ntp::tos: false ntp::udlc_stratum: 10 ntp::udlc: false puppetlabs-ntp-7.1.1/examples0040755005276200011600000000000013237313253013227 5ustar00puppetlabs-ntp-7.1.1/examples/init.pp0100644005276200011600000000026713207476405014622 0ustar00node default { notify { 'enduser-before': } notify { 'enduser-after': } class { 'ntp': require => Notify['enduser-before'], before => Notify['enduser-after'], } } puppetlabs-ntp-7.1.1/hiera.yaml0100644005276200011600000000067213232340314013437 0ustar00--- version: 5 defaults: datadir: 'data' data_hash: 'yaml_data' hierarchy: - name: 'Full Version' path: '%{facts.os.name}-%{facts.os.release.full}.yaml' - name: 'Major Version' path: '%{facts.os.name}-%{facts.os.release.major}.yaml' - name: 'Distribution Name' path: '%{facts.os.name}.yaml' - name: 'Operating System Family' path: '%{facts.os.family}-family.yaml' - name: 'common' path: 'common.yaml' puppetlabs-ntp-7.1.1/locales0040755005276200011600000000000013237313253013033 5ustar00puppetlabs-ntp-7.1.1/locales/config.yaml0100644005276200011600000000203613207476405015247 0ustar00--- # This is the project-specific configuration file for setting up # fast_gettext for your project. gettext: # This is used for the name of the .pot and .po files; they will be # called .pot? project_name: puppetlabs-ntp # This is used in comments in the .pot and .po files to indicate what # project the files belong to and should bea little more desctiptive than # package_name: puppetlabs-ntp # The locale that the default messages in the .pot file are in default_locale: en # The email used for sending bug reports. bugs_address: docs@puppet.com # The holder of the copyright. copyright_holder: Puppet, Inc. # This determines which comments in code should be eligible for translation. # Any comments that start with this string will be externalized. (Leave # empty to include all.) comments_tag: TRANSLATOR # Patterns for +Dir.glob+ used to find all files that might contain # translatable content, relative to the project root directory source_files: - './lib/**/*.rb' puppetlabs-ntp-7.1.1/locales/ja0040755005276200011600000000000013237313253013425 5ustar00puppetlabs-ntp-7.1.1/locales/ja/puppetlabs-ntp.po0100644005276200011600000000175013207476405017030 0ustar00# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-21 14:19+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: LarissaLane , 2017\n" "Language-Team: Japanese (Japan) (https://www.transifex.com/puppet/teams/29089/ja_JP/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ja_JP\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Translate Toolkit 2.0.0\n" #. metadata.json #: .summary msgid "Installs, configures, and manages the NTP service." msgstr "NTPサービスのインストール、設定、および管理。" #. metadata.json #: .description msgid "" "NTP Module for Debian, Ubuntu, CentOS, RHEL, OEL, Fedora, FreeBSD, " "ArchLinux, Amazon Linux and Gentoo." msgstr "" "Debian、Ubuntu、CentOS、RHEL、OEL、Fedora、FreeBSD、ArchLinux、Amazon " "Linux、およびGentoo用のNTPモジュール。" puppetlabs-ntp-7.1.1/locales/puppetlabs-ntp.pot0100644005276200011600000000124213207476405016616 0ustar00#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-21 14:19+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Translate Toolkit 2.0.0\n" #. metadata.json #: .summary msgid "Installs, configures, and manages the NTP service." msgstr "" #. metadata.json #: .description msgid "" "NTP Module for Debian, Ubuntu, CentOS, RHEL, OEL, Fedora, FreeBSD, " "ArchLinux, Amazon Linux and Gentoo." msgstr "" puppetlabs-ntp-7.1.1/manifests0040755005276200011600000000000013237313253013402 5ustar00puppetlabs-ntp-7.1.1/manifests/config.pp0100644005276200011600000000537413232340314015266 0ustar00# @api private # This class handles the configuration file. Avoid modifying private classes. class ntp::config { #The servers-netconfig file overrides NTP config on SLES 12, interfering with our configuration. if ($facts['operatingsystem'] == 'SLES' and $facts['operatingsystemmajrelease'] == '12') or ($facts['operatingsystem'] == 'OpenSuSE' and $facts['operatingsystemmajrelease'] == '42') { file { '/var/run/ntp/servers-netconfig': ensure => 'absent' } } if $ntp::keys_enable { case $ntp::config_dir { '/', '/etc', undef: {} default: { file { $ntp::config_dir: ensure => directory, owner => 0, group => 0, mode => '0775', recurse => false, } } } file { $ntp::keys_file: ensure => file, owner => 0, group => 0, mode => '0600', content => epp('ntp/keys.epp'), } } #If both epp and erb are defined, throw validation error. #Otherwise use the defined erb/epp template, or use default if $ntp::config_epp and $ntp::config_template { fail('Cannot supply both config_epp and config_template templates for ntp config file.') } elsif $ntp::config_template { $config_content = template($ntp::config_template) } elsif $ntp::config_epp { $config_content = epp($ntp::config_epp) } else { $config_content = epp('ntp/ntp.conf.epp') } file { $ntp::config: ensure => file, owner => 0, group => 0, mode => $::ntp::config_file_mode, content => $config_content, } #If both epp and erb are defined, throw validation error. #Otherwise use the defined erb/epp template, or use default if $::ntp::step_tickers_file { if $::ntp::step_tickers_template and $::ntp::step_tickers_epp { fail('Cannot supply both step_tickers_file and step_tickers_epp templates for step ticker file') } elsif $::ntp::step_tickers_template { $step_ticker_content = template($ntp::step_tickers_template) } elsif $::ntp::step_tickers_epp { $step_ticker_content = epp($::ntp::step_tickers_epp) } else{ $step_ticker_content = epp('ntp/step-tickers.epp') } file { $::ntp::step_tickers_file: ensure => file, owner => 0, group => 0, mode => $::ntp::config_file_mode, content => $step_ticker_content, } } if $ntp::logfile { file { $ntp::logfile: ensure => file, owner => 'ntp', group => 'ntp', mode => '0664', } } if $ntp::disable_dhclient { augeas { 'disable ntp-servers in dhclient.conf': context => '/files/etc/dhcp/dhclient.conf', changes => 'rm request/*[.="ntp-servers"]', } file { '/var/lib/ntp/ntp.conf.dhcp': ensure => absent, } } } puppetlabs-ntp-7.1.1/manifests/init.pp0100644005276200011600000002504213232340314014756 0ustar00# ntp # # Main class, includes all other classes. # # @param authprov # Enables compatibility with W32Time in some versions of NTPd (such as Novell DSfW). Default value: undef. # # @param broadcastclient # Enables reception of broadcast server messages to any local interface. Default value: false. # # @param config # Specifies a file for NTP's configuration info. Default value: '/etc/ntp.conf' (or '/etc/inet/ntp.conf' on Solaris). # # @param config_dir # Specifies a directory for the NTP configuration files. Default value: undef. # # @param config_epp # Specifies an absolute or relative file path to an EPP template for the config file. # Example value: 'ntp/ntp.conf.epp'. A validation error is thrown if both this **and** the `config_template` parameter are specified. # # @param config_file_mode # Specifies a file mode for the ntp configuration file. Default value: '0664'. # # @param config_template # Specifies an absolute or relative file path to an ERB template for the config file. # Example value: 'ntp/ntp.conf.erb'. A validation error is thrown if both this **and** the `config_epp` parameter are specified. # # @param disable_auth # Disables cryptographic authentication for broadcast client, multicast client, and symmetric passive associations. # # @param disable_dhclient # Disables `ntp-servers` in `dhclient.conf` to prevent Dhclient from managing the NTP configuration. # # @param disable_kernel # Disables kernel time discipline. # # @param disable_monitor # Disables the monitoring facility in NTP. Default value: true. # # @param driftfile # Specifies an NTP driftfile. Default value: '/var/lib/ntp/drift' (except on AIX and Solaris). # # @param enable_mode7 # Enables processing of NTP mode 7 implementation-specific requests which are used by the deprecated ntpdc program. Default value: false. # # @param fudge # Provides additional information for individual clock drivers. Default value: [ ] # # @param iburst_enable # Specifies whether to enable the iburst option for every NTP peer. Default value: false (true on AIX and Debian). # # @param interfaces # Specifies one or more network interfaces for NTP to listen on. Default value: [ ]. # # @param interfaces_ignore # Specifies one or more ignore pattern for the NTP listener configuration (for example: all, wildcard, ipv6). Default value: [ ]. # # @param keys # Distributes keys to keys file. Default value: [ ]. # # @param keys_controlkey # Specifies the key identifier to use with the ntpq utility. Value in the range of 1 to 65,534 inclusive. Default value: ' '. # # @param keys_enable # Whether to enable key-based authentication. Default value: false. # # @param keys_file # Specifies the complete path and location of the MD5 key file containing the keys and key identifiers used by ntpd, ntpq and ntpdc # when operating with symmetric key cryptography. Default value: `/etc/ntp.keys` (on RedHat and Amazon, `/etc/ntp/keys`). # # @param keys_requestkey # Specifies the key identifier to use with the ntpdc utility program. Value in the range of 1 to 65,534. Default value: ' '. # # @param keys_trusted # Provides one or more keys to be trusted by NTP. Default value: [ ]. # # @param leapfile # Specifies a leap second file for NTP to use. Default value: ' '. # # @param logfile # Specifies a log file for NTP to use instead of syslog. Default value: ' '. # # @param minpoll # Sets Puppet to non-standard minimal poll interval of upstream servers. # Values: 3 to 16. Default: undef. # # @param maxpoll # Sets use non-standard maximal poll interval of upstream servers. # Values: 3 to 16. Default option: undef, except on FreeBSD (on FreeBSD, defaults to 9). # # @param ntpsigndsocket # Sets NTP to sign packets using the socket in the ntpsigndsocket path. Requires NTP to be configured to sign sockets. # Value: Path to the socket directory; for example, for Samba: `usr/local/samba/var/lib/ntp_signd/`. Default value: undef. # # @param package_ensure # Whether to install the NTP package, and what version to install. Values: 'present', 'latest', or a specific version number. # Default value: 'present'. # # @param package_manage # Whether to manage the NTP package. Default value: true. # # @param package_name # Specifies the NTP package to manage. Default value: ['ntp'] (except on AIX and Solaris). # # @param panic # Whether NTP should "panic" in the event of a very large clock skew. Applies only if `tinker` option set to true or if your environment # is in a virtual machine. Default value: 0 if environment is virtual, undef in all other cases. # # @param peers # List of NTP servers with which to synchronise the local clock. # # @param pool # List of NTP server pools with which to synchronise the local clock. # # @param preferred_servers # Specifies one or more preferred peers. Puppet appends 'prefer' to each matching item in the `servers` array. # Default value: [ ]. # # @param noselect_servers # Specifies one or more peers to not sync with. Puppet appends 'noselect' to each matching item in the `servers` array. # Default value: [ ]. # # @param restrict # Specifies one or more `restrict` options for the NTP configuration. # Puppet prefixes each item with 'restrict', so you need to list only the content of the restriction. # Default value for most operating systems: # '[default kod nomodify notrap nopeer noquery', '-6 default kod nomodify notrap nopeer noquery', '127.0.0.1', '-6 ::1']'. # Default value for AIX systems: # '['default nomodify notrap nopeer noquery', '127.0.0.1',]'. # # @param servers # Specifies one or more servers to be used as NTP peers. Default value: varies by operating system. # # @param service_enable # Whether to enable the NTP service at boot. Default value: true. # # @param service_ensure # Whether the NTP service should be running. Default value: 'running'. # # @param service_manage # Whether to manage the NTP service. Default value: true. # # @param service_name # The NTP service to manage. Default value: varies by operating system. # # @param service_provider # Which service provider to use for NTP. Default value: 'undef'. # # @param slewalways # xntpd setting to disable stepping behavior and always slew the clock to handle adjustments. # Only relevant for AIX. Default value: 'undef'. Allowed values: 'yes', 'no' # # @param statistics # List of statistics to have NTP generate and keep. Default value: [ ]. # # @param statsdir # Location of the NTP statistics directory on the managed system. Default value: '/var/log/ntpstats'. # # @param step_tickers_file # Location of the step tickers file on the managed system. Default value: varies by operating system. # # @param step_tickers_epp # Location of the step tickers EPP template file. Default value: varies by operating system. # Validation error is thrown if both this and the `step_tickers_template` parameters are specified. # # @param step_tickers_template # Location of the step tickers ERB template file. Default value: varies by operating system. # Validation error is thrown if both this and the `step_tickers_epp` parameter are specified. # # @param stepout # Value for stepout if `tinker` value is true. Valid options: unsigned shortint digit. Default value: undef. # # @param tos # Whether to enable tos options. Default value: false. # # @param tos_minclock # Specifies the minclock tos option. Default value: 3. # # @param tos_minsane # Specifies the minsane tos option. Default value: 1. # # @param tos_floor # Specifies the floor tos option. Default value: 1. # # @param tos_ceiling # Specifies the ceiling tos option. Default value: 15. # # @param tos_cohort # Specifies the cohort tos option. Valid options: 0 or 1. Default value: 0. # # @param tinker # Whether to enable tinker options. Default value: false. # # @param udlc # Specifies whether to configure NTP to use the undisciplined local clock as a time source. Default value: false. # # @param udlc_stratum # Specifies the stratum the server should operate at when using the undisciplined local clock as the time source. # This value should be set to no less than 10 if ntpd might be accessible outside your immediate, controlled network. # Default value: 10.am udlc # class ntp ( Boolean $broadcastclient, Stdlib::Absolutepath $config, Optional[Stdlib::Absolutepath] $config_dir, String $config_file_mode, Optional[String] $config_epp, Optional[String] $config_template, Boolean $disable_auth, Boolean $disable_dhclient, Boolean $disable_kernel, Boolean $disable_monitor, Boolean $enable_mode7, Optional[Array[String]] $fudge, Stdlib::Absolutepath $driftfile, Optional[Stdlib::Absolutepath] $leapfile, Optional[Stdlib::Absolutepath] $logfile, Boolean $iburst_enable, Array[String] $keys, Boolean $keys_enable, Stdlib::Absolutepath $keys_file, Optional[Ntp::Key_id] $keys_controlkey, Optional[Ntp::Key_id] $keys_requestkey, Optional[Array[Ntp::Key_id]] $keys_trusted, Optional[Ntp::Poll_interval] $minpoll, Optional[Ntp::Poll_interval] $maxpoll, String $package_ensure, Boolean $package_manage, Array[String] $package_name, Optional[Integer[0]] $panic, Array[String] $peers, Optional[Array[String]] $pool, Array[String] $preferred_servers, Array[String] $noselect_servers, Array[String] $restrict, Array[String] $interfaces, Array[String] $interfaces_ignore, Array[String] $servers, Boolean $service_enable, Enum['running', 'stopped'] $service_ensure, Boolean $service_manage, String $service_name, Optional[String] $service_provider, Optional[Enum['yes','no']] $slewalways, Optional[Array] $statistics, Optional[Stdlib::Absolutepath] $statsdir, Optional[Integer[0, 65535]] $stepout, Optional[Stdlib::Absolutepath] $step_tickers_file, Optional[String] $step_tickers_epp, Optional[String] $step_tickers_template, Optional[Boolean] $tinker, Boolean $tos, Optional[Integer[1]] $tos_maxclock, Optional[Integer[1]] $tos_minclock, Optional[Integer[1]] $tos_minsane, Optional[Integer[1]] $tos_floor, Optional[Integer[1]] $tos_ceiling, Variant[Boolean, Integer[0,1]] $tos_cohort, Boolean $udlc, Optional[Integer[1,15]] $udlc_stratum, Optional[Stdlib::Absolutepath] $ntpsigndsocket, Optional[String] $authprov, ) { # defaults for tinker and panic are different, when running on virtual machines if $facts['is_virtual'] { $_tinker = pick($tinker, true) $_panic = pick($panic, 0) } else { $_tinker = pick($tinker, false) $_panic = $panic } contain ntp::install contain ntp::config contain ntp::service Class['::ntp::install'] -> Class['::ntp::config'] ~> Class['::ntp::service'] } puppetlabs-ntp-7.1.1/manifests/install.pp0100644005276200011600000000033413232340314015456 0ustar00# @api private # This class handles ntp packages. Avoid modifying private classes. class ntp::install { if $ntp::package_manage { package { $ntp::package_name: ensure => $ntp::package_ensure, } } } puppetlabs-ntp-7.1.1/manifests/service.pp0100644005276200011600000000061613232340314015453 0ustar00# @api private # This class handles the ntp service. Avoid modifying private classes. class ntp::service { if $ntp::service_manage == true { service { 'ntp': ensure => $ntp::service_ensure, enable => $ntp::service_enable, name => $ntp::service_name, provider => $ntp::service_provider, hasstatus => true, hasrestart => true, } } } puppetlabs-ntp-7.1.1/metadata.json0100644005276200011600000000444213237313253014144 0ustar00{ "name": "puppetlabs-ntp", "version": "7.1.1", "author": "Puppet Inc", "summary": "Installs, configures, and manages the NTP service.", "license": "Apache-2.0", "source": "https://github.com/puppetlabs/puppetlabs-ntp", "project_page": "https://github.com/puppetlabs/puppetlabs-ntp", "issues_url": "https://tickets.puppetlabs.com/browse/MODULES", "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.13.1 < 5.0.0" } ], "data_provider": null, "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "5", "6", "7" ] }, { "operatingsystem": "Fedora", "operatingsystemrelease": [ "24", "25" ] }, { "operatingsystem": "SLES", "operatingsystemrelease": [ "11 SP1", "12" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "7", "8" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "14.04", "16.04" ] }, { "operatingsystem": "Solaris", "operatingsystemrelease": [ "11" ] }, { "operatingsystem": "AIX", "operatingsystemrelease": [ "5.3", "6.1", "7.1" ] }, { "operatingsystem": "Amazon", "operatingsystemrelease": [ "2013.09", "2014.03", "2014.09", "2015.03" ] }, { "operatingsystem": "Archlinux" } ], "requirements": [ { "name": "puppet", "version_requirement": ">= 4.9.4 < 6.0.0" } ], "description": "NTP Module for Debian, Ubuntu, CentOS, RHEL, OEL, Fedora, FreeBSD, ArchLinux, Amazon Linux and Gentoo.", "template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git", "template-ref": "1.3.2-0-g07678c8" } puppetlabs-ntp-7.1.1/readmes0040755005276200011600000000000013237313253013031 5ustar00puppetlabs-ntp-7.1.1/readmes/README_ja_JP.md0100644005276200011600000004147013237313141015431 0ustar00# ntp #### 目次 1. [モジュールの概要 - ntpモジュールについて](#モジュールの概要) 1. [セットアップ - ntpを開始するにあたっての基本設定](#セットアップ) 1. [利用例 - 設定オプションと追加機能](#利用例) 1. [参照 - モジュールのクラスやパラメータの説明](#参照) 1. [制限事項 - OSの互換性など](#制限事項) 1. [開発 - モジュールへの貢献方法](#開発) ## モジュールの概要 このモジュールは様々なOSや環境において、NTPサービスをインストール、設定、管理するものです。 ## セットアップ ### ntpモジュールの利用方法 `include ntp`と記述するだけで利用可能です。参照するNTPサーバは、以下のようにパラメータで指定します。 ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], } ``` ## 利用例 ntpモジュールのすべてのパラメータは、メインクラスである`ntp`クラスに含まれているため、ntpモジュールで利用可能な全てのオプションを自由に設定できます。以下にユースケースを示します。 ### NTPをインストールして有効にする ```puppet include ntp ``` ### NTPサーバを変更する ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], } ``` ### 接続可能ユーザ数を制限する ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], restrict => ['127.0.0.1'], } ``` ### 参照不可のNTPクライアントをインストールする ```puppet class { 'ntp': servers => ['ntp1.corp.com', 'ntp2.corp.com'], restrict => [ 'default ignore', '-6 default ignore', '127.0.0.1', '-6 ::1', 'ntp1.corp.com nomodify notrap nopeer noquery', 'ntp2.corp.com nomodify notrap nopeer noquery' ], } ``` ### 特定のインターフェイスでのみLISTENする Openstackノードには多数の仮想インターフェイスが存在する場合があるため、NTPサーバでLISTENするインターフェイスを特定のインターフェイスに制限するのは有効な手段です。 ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], interfaces => ['127.0.0.1', '1.2.3.4'] } ``` ### Puppetによるサービスの制御を中止する ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], restrict => ['127.0.0.1'], service_manage => false, } ``` ### ntpパッケージはインストールせず、設定とサービス起動のみ実行する ```puppet class { 'ntp': package_manage => false, } ``` ### カスタムテンプレートにパラメータを渡す ```puppet class { 'ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], restrict => ['127.0.0.1'], service_manage => false, config_epp => 'different/module/custom.template.epp', } ``` ## 参照 ### クラス #### パブリッククラス * ntp: その他すべてのクラスを含むメインクラス。 #### プライベートクラス * ntp::install: パッケージのインストール * ntp::config: 設定ファイルのセットアップ * ntp::service: サービスの制御 ### パラメータ `ntp`クラスでは、以下のパラメータを使用できます。 #### `authprov` 任意 データタイプ: 文字列 NTPdの一部のバージョン(Novell DSfWなど)で、W32Timeとの互換性を確保できます。 デフォルト値: `undef` #### `broadcastclient` データタイプ: 真偽値(boolean) あらゆるローカルインターフェイスでブロードキャストサーバのメッセージを受信できるようになります。 デフォルト値: `false` #### `config` データタイプ: Stdlib::Absolutepath. NTPの構成情報を含むファイルを指定します。 デフォルト値: '/etc/ntp.conf' (Solaris: '/etc/inet/ntp.conf') #### `config_dir` 任意 データタイプ: Stdlib::Absolutepath. NTP構成ファイルのディレクトリを指定します。 デフォルト値: `undef` #### `config_epp` 任意 データタイプ: 文字列 構成ファイルのEPPテンプレートへの絶対パスまたは相対パスを指定します(値の例: 'ntp/ntp.conf.epp')。このパラメータと`config_template`パラメータの**両方**を指定すると、バリデーションエラーが発生します。 #### `config_file_mode` データタイプ: 文字列 設定ファイルのファイルモードを指定します。 デフォルト値: '0664' #### `config_template` 任意 データタイプ: 文字列 構成ファイルのERBテンプレートへの絶対パスまたは相対パスを指定します(値の例: 'ntp/ntp.conf.erb')。このパラメータと`config_epp`パラメータの**両方**を指定すると、バリデーションエラーが発生します。 #### `disable_auth` データタイプ: 真偽値(boolean) ブロードキャストクライアントモード、マルチキャストクライアントモード、対象モード/ピアモードの暗号化認証を無効にします。 #### `disable_dhclient` データタイプ: 真偽値(boolean) `dhclient.conf`内の`ntp-servers`を無効にすることによって、DhclientがNTPの設定を管理できないようにします。 #### `disable_kernel` データタイプ: 真偽値(boolean) カーネルによる時刻の調整を無効にします。 #### `disable_monitor` データタイプ: 真偽値(boolean) NTP内のモニタリング機能を無効にします。 デフォルト値: `true` #### `driftfile` データタイプ: Stdlib::Absolutepath. NTP driftfileの保存場所を指定します。 デフォルト値: '/var/lib/ntp/drift' (AIX: 'ntp::driftfile:', Solaris: '/var/ntp/ntp.drift'). #### `enable_mode7` データタイプ: 真偽値(boolean) 非推奨のntpdcプログラムによって使用される、NTPモード7の実装固有リクエストの処理を有効化します。 デフォルト値: `false` #### `fudge` 任意 データタイプ: 配列[文字列] 個々のクロックドライバの追加情報を提供します。 デフォルト値: [ ] #### `iburst_enable` データタイプ: 真偽値(boolean) すべてのNTPピアのiburstオプションを有効にするかどうかを指定します。 デフォルト値: `false` (AIX、Debian: `true`) #### `interfaces` データタイプ: 配列[文字列] NTPがLISTENする1つ以上のネットワークインターフェイスを指定します。 デフォルト値: [ ] #### `interfaces_ignore` データタイプ: 配列[文字列] 1つ以上のNTPリスナー設定で無視するパターン(例: all、wildcard、ipv6)を指定します。 デフォルト値: [ ] #### `keys` データタイプ: 配列[文字列] 鍵ファイルに鍵を配布します。 デフォルト値: [ ] #### `keys_controlkey` 任意 データタイプ: Ntp::Key_id ntpqユーティリティと共に使用する鍵識別子(値の範囲: 1~65,534)を指定します。 デフォルト値: ' ' #### `keys_enable` データタイプ: 真偽値(boolean) 鍵による認証を有効にするかどうかを指定します。 デフォルト値: `false` #### `keys_file` Stdlib::Absolutepath. MD5鍵ファイルの完全パスと保存場所を指定します。MD5鍵ファイルには、対称鍵暗号の使用時にntpd、ntpqおよびntpdcが使用する鍵と鍵識別子が含まれています。 デフォルト値: '/etc/ntp.keys' (RedHat、Amazon: `/etc/ntp/keys`) #### `keys_requestkey` 任意 データタイプ: Ntp::Key_id ntpdcユーティリティプログラムと共に使用する鍵識別子(値の範囲: 1~65,534)を指定します。 デフォルト値: ' ' #### `keys_trusted` 任意 データタイプ: 配列[Ntp::Key_id] NTPが信頼している1つ以上の鍵を提供します。 デフォルト値: [ ] #### `leapfile` 任意 データタイプ: Stdlib::Absolutepath. NTPが使用する「うるう秒ファイル」を指定します。 デフォルト値: ' ' #### `logfile` 任意 データタイプ: Stdlib::Absolutepath. NTPがsyslogの代わりに使用するログファイルを指定します。 デフォルト値: ' ' #### `minpoll` 任意 データタイプ: Ntp::Poll_interval Puppetをアップストリームサーバの規格外の最小ポーリング間隔に設定します(値: 4~17)。 デフォルト: `undef` #### `maxpoll` 任意 データタイプ: Ntp::Poll_interval アップストリームサーバの規格外の最大ポーリング間隔に設定します(値: 4~17)。 デフォルトオプション: `undef`(FreeBSD: 9) #### `ntpsigndsocket` 任意 データタイプ: Stdlib::Absolutepath. NTPがntpsigndsocketパスのソケットを使用してパケットに署名するよう設定します。NTPがソケットに署名するよう設定されていなければなりません。値: ソケットディレクトリへのパス(例: Samba: `usr/local/samba/var/lib/ntp_signd/`)。 デフォルト値: `undef` #### `package_ensure` データタイプ: 文字列 NTPパッケージをインストールするかどうか、インストールする場合はどのバージョンをインストールするかを指定します(値: 'present'、'latest'、または特定のバージョン番号)。 デフォルト値: 'present' #### `package_manage` データタイプ: 真偽値(boolean) NTPパッケージを管理するかどうか指定します。 デフォルト値: `true` #### `package_name` データタイプ: 配列[文字列] 管理するNTPパッケージを指定します。 デフォルト値: ['ntp'] (AIX: 'bos.net.tcp.client'、Solaris: [ 'SUNWntp4r'、'SUNWntp4u' ]) #### `panic` 任意 データタイプ: 整数[0] クロックキューが大きすぎる場合にNTPでパニックを発生させ終了させるかどうか指定します。この指定は`tinker`オプションが`true`に設定されている場合のみ、または仮想マシン環境でのみ適用されます。 デフォルト値: `undef` (仮想環境: 0) #### `pool` 任意 データタイプ: 配列[文字列] ローカルクロックを同期させるNTPサーバプールのリスト デフォルト値: [ ] #### `peers` データタイプ: 配列[文字列] ローカルクロックを同期させるNTPサーバのリスト #### `preferred_servers` データタイプ: 配列[文字列] 1つ以上の優先ピアを指定します。Puppetによって`servers`配列内の一致する項目の最後に'prefer'が追加されます。 デフォルト値: [ ] #### `noselect_servers` 配列[文字列]で、同期させない1つ以上のピアを指定します。Puppetによって`servers`配列内の一致する項目の最後に'noselect'が追加されます。デフォルト値: [ ] #### `restrict` データタイプ: 配列[文字列] NTP設定の1つ以上の`restrict`オプションを指定します。Puppetによって各項目の先頭に'restrict'が追加されるため、リストする必要があるのは制限事項の内容のみです。 ほとんどのオペレーティングシステムでのデフォルト値: ```shell [ 'default kod nomodify notrap nopeer noquery', '-6 default kod nomodify notrap nopeer noquery', '127.0.0.1', '-6 ::1', ] ``` AIXシステムのデフォルト値: ```shell [ 'default nomodify notrap nopeer noquery', '127.0.0.1', ] ``` #### `servers` データタイプ: 配列[文字列] NTPピアとして使用する1つ以上のサーバを指定します。 デフォルト値: オペレーティングシステムによって異なります。 #### `service_enable` データタイプ: 真偽値(boolean) 起動時にNTPサービスを有効にするかどうか指定します。 デフォルト値: `true` #### `service_ensure` データタイプ: Enum['running'、'stopped'] NTPサービスを実行するかどうか指定します。 デフォルト値: 'running' #### `service_manage` データタイプ: 真偽値(boolean) NTPサービスを管理するかどうか指定します。 デフォルト値: `true` #### `service_name` データタイプ: 文字列 管理対象のNTPサービス デフォルト値: オペレーティングシステムによって異なります。 #### `service_provider` データタイプ: 文字列 NTPに使用するサービスプロバイダ デフォルト値: `undef` #### `slewalways` データタイプ: Enum['no'、'yes'] step動作を無効にし常にslewモードで徐々に時計を合わせるよう`xntpd`を設定するかどうかを指定します。 AIXといった`xntpd`を実行するプラットフォームにのみ適用し、その他のプラットフォームにこの設定を指定しないようにしてください。 デフォルト値: オペレーティングシステムによって異なります。 #### `statistics` データタイプ: 配列 ntpモニタリングが有効になっている場合に収集する統計のリスト デフォルト値: [] #### `statsdir` データタイプ: Stdlib::Absolutepath. NTP統計の保存先(ntpモニタリングが有効になっている場合) デフォルト値: '/var/log/ntpstats' #### `step_tickers_file` 任意 データタイプ: Stdlib::Absolutepath. 管理対象システム上のstep tickersファイルの保存場所 デフォルト値: オペレーティングシステムによって異なります。 #### `step_tickers_epp` 任意 データタイプ: 文字列 step tickers EPPテンプレートファイルの保存場所。このパラメータと`step_tickers_template`パラメータの両方を指定すると、バリデーションエラーが発生します。 デフォルト値: オペレーティングシステムによって異なります。 #### `step_tickers_template` 任意 データタイプ: 文字列 step tickers ERBテンプレートファイルの保存場所。 このパラメータと`step_tickers_epp`パラメータの両方を指定すると、バリデーションエラーが発生します。 デフォルト値: オペレーティングシステムによって異なります。 #### `stepout` 任意 データタイプ: 整数[0, 65535] `tinker`値が`true`の場合のstepoutの値。有効なオプション: unsigned shortint digit デフォルト値: `undef` #### `tos` データタイプ: 真偽値(boolean) tosオプションを有効にするかどうかを指定します。 デフォルト値: `false` #### `tos_maxclock` 任意 データタイプ: 整数[1] maxclock tosオプションを指定します。 デフォルト値: 6。 #### `tos_minclock` 任意 データタイプ: 整数[1] minclock tosオプションを指定します。 デフォルト値: 3 #### `tos_minsane` 任意 データタイプ: 整数[1] minsane tosオプションを指定します。 デフォルト値: 1 #### `tos_floor` 任意 データタイプ: 整数[1] floor tosオプションを指定します。 デフォルト値: 1 #### `tos_ceiling` 任意 データタイプ: 整数[1] ceiling tosオプションを指定します。 デフォルト値: 15 #### `tos_cohort` データタイプ: 真偽値(boolean)、整数[0,1] cohort tosオプションを指定します。有効なオプション: 0または1 デフォルト値: 0 #### `tinker` データタイプ: 真偽値(boolean) tinkerオプションを有効にするかどうかを指定します。 デフォルト値: `false` #### `udlc` データタイプ: 真偽値(boolean) Undisciplined Local Clockを時刻ソースとして使用するようNTPを設定するかどうか指定します。 デフォルト値: `false` #### `udlc_stratum` 任意。データタイプ: 整数[1,15] Undisciplined Local Clockを時刻ソースとして使用する場合にサーバを実行する階層を指定します。ntpdが外部アクセス可能なネットワークに接続する場合は、この値を10以上にする必要があります。 デフォルト値: 10 ## 制限事項 このモジュールは[PE対応のすべてのプラットフォーム](https://forge.puppetlabs.com/supported#compat-matrix)上でテスト済みです。さらに、Solaris 10とFedora 20-22上でもテスト済み(ただし非対応)です。 ## 開発 Puppet Forge上のPuppetモジュールは公開プロジェクトです。このモジュールの今後の進展にはコミュニティによる協力が不可欠です。変更にご協力いただける場合はガイドラインに従ってください。 詳しくは[モジュールへの貢献に関するガイド](https://docs.puppetlabs.com/forge/contributing.html)をご覧ください。 ### 貢献者 すでにご協力いただいている方のリストについては、[貢献者リスト](https://github.com/puppetlabs/puppetlabs-ntp/graphs/contributors)をご覧ください。puppetlabs-ntp-7.1.1/spec0040755005276200011600000000000013237313253012343 5ustar00puppetlabs-ntp-7.1.1/spec/acceptance0040755005276200011600000000000013237313253014431 5ustar00puppetlabs-ntp-7.1.1/spec/acceptance/class_spec.rb0100644005276200011600000000232213232340314017141 0ustar00require 'spec_helper_acceptance' describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'with ntp' do let(:pp) { "class { 'ntp': }" } it 'runs successfully - not_to match' do apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to match(%r{error}i) end end it 'runs successfully - not_to eq' do apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to eq(%r{error}i) end end it 'runs successfully - to be_zero' do apply_manifest(pp, catch_failures: true) do |r| expect(r.exit_code).to be_zero end end end context 'when service_ensure => stopped:' do let(:pp) { "class { 'ntp': service_ensure => stopped }" } it 'runs successfully - not_to match' do apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to match(%r{error}i) end end end context 'when service_ensure => running:' do it 'runs successfully - not_to match' do pp = "class { 'ntp': service_ensure => running }" apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to match(%r{error}i) end end end end puppetlabs-ntp-7.1.1/spec/acceptance/disable_monitoring_spec.rb0100644005276200011600000000165013232340314021707 0ustar00require 'spec_helper_acceptance' config = if fact('osfamily') == 'Solaris' '/etc/inet/ntp.conf' else '/etc/ntp.conf' end describe 'ntp class with disable_monitor:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'with should disable' do let(:pp) { "class { 'ntp': disable_monitor => true }" } it 'runs twice' do apply_manifest(pp, catch_failures: true) apply_manifest(pp, catch_changes: true) end describe file(config.to_s) do its(:content) { is_expected.to match('disable monitor') } end end context 'when enabled' do let(:pp) { "class { 'ntp': disable_monitor => false }" } it 'runs twice' do apply_manifest(pp, catch_failures: true) apply_manifest(pp, catch_changes: true) end describe file(config.to_s) do its(:content) { is_expected.not_to match('disable monitor') } end end end puppetlabs-ntp-7.1.1/spec/acceptance/enable_mode7_spec.rb0100644005276200011600000000162113232340314020356 0ustar00require 'spec_helper_acceptance' config = if fact('osfamily') == 'Solaris' '/etc/inet/ntp.conf' else '/etc/ntp.conf' end describe 'ntp class with enable_mode7:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'with enable' do let(:pp) { "class { 'ntp': enable_mode7 => true }" } it 'runs twice' do apply_manifest(pp, catch_failures: true) apply_manifest(pp, catch_changes: true) end describe file(config.to_s) do its(:content) { is_expected.to match('enable mode7') } end end context 'with disable' do let(:pp) { "class { 'ntp': enable_mode7 => false }" } it 'runs twice' do apply_manifest(pp, catch_failures: true) apply_manifest(pp, catch_changes: true) end describe file(config.to_s) do its(:content) { is_expected.not_to match('enable mode7') } end end end puppetlabs-ntp-7.1.1/spec/acceptance/nodesets0040755005276200011600000000000013237313253016255 5ustar00puppetlabs-ntp-7.1.1/spec/acceptance/nodesets/centos-7-x64.yml0100644005276200011600000000025613207476405021143 0ustar00HOSTS: centos-7-x64: roles: - agent - default platform: el-7-x86_64 hypervisor: vagrant box: puppetlabs/centos-7.2-64-nocm CONFIG: type: foss puppetlabs-ntp-7.1.1/spec/acceptance/nodesets/debian-8-x64.yml0100644005276200011600000000026113207476405021067 0ustar00HOSTS: debian-8-x64: roles: - agent - default platform: debian-8-amd64 hypervisor: vagrant box: puppetlabs/debian-8.2-64-nocm CONFIG: type: foss puppetlabs-ntp-7.1.1/spec/acceptance/nodesets/default.yml0100644005276200011600000000027213207476405020507 0ustar00HOSTS: ubuntu-1404-x64: roles: - agent - default platform: ubuntu-14.04-amd64 hypervisor: vagrant box: puppetlabs/ubuntu-14.04-64-nocm CONFIG: type: foss puppetlabs-ntp-7.1.1/spec/acceptance/nodesets/docker0040755005276200011600000000000013237313253017524 5ustar00puppetlabs-ntp-7.1.1/spec/acceptance/nodesets/docker/centos-7.yml0100644005276200011600000000057513207476405021777 0ustar00HOSTS: centos-7-x64: platform: el-7-x86_64 hypervisor: docker image: centos:7 docker_preserve_image: true docker_cmd: '["/usr/sbin/init"]' # install various tools required to get the image up to usable levels docker_image_commands: - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts' CONFIG: trace_limit: 200 puppetlabs-ntp-7.1.1/spec/acceptance/nodesets/docker/debian-8.yml0100644005276200011600000000054413207476405021723 0ustar00HOSTS: debian-8-x64: platform: debian-8-amd64 hypervisor: docker image: debian:8 docker_preserve_image: true docker_cmd: '["/sbin/init"]' docker_image_commands: - 'apt-get update && apt-get install -y net-tools wget locales strace lsof && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen' CONFIG: trace_limit: 200 puppetlabs-ntp-7.1.1/spec/acceptance/nodesets/docker/ubuntu-14.04.yml0100644005276200011600000000073213207476405022321 0ustar00HOSTS: ubuntu-1404-x64: platform: ubuntu-14.04-amd64 hypervisor: docker image: ubuntu:14.04 docker_preserve_image: true docker_cmd: '["/sbin/init"]' docker_image_commands: # ensure that upstart is booting correctly in the container - 'rm /usr/sbin/policy-rc.d && rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl && apt-get update && apt-get install -y net-tools wget && locale-gen en_US.UTF-8' CONFIG: trace_limit: 200 puppetlabs-ntp-7.1.1/spec/acceptance/noselect_servers_spec.rb0100644005276200011600000000155113232340314021424 0ustar00require 'spec_helper_acceptance' config = if fact('osfamily') == 'Solaris' '/etc/inet/ntp.conf' else '/etc/ntp.conf' end describe 'noselect servers', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do pp = <<-MANIFEST class { '::ntp': servers => ['a', 'b', 'c', 'd'], noselect_servers => ['c', 'd'], } MANIFEST it 'applies cleanly' do apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to match(%r{error}i) end end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match 'server a' } its(:content) { is_expected.to match 'server b' } its(:content) { is_expected.to match %r{server c (iburst\s|)noselect} } its(:content) { is_expected.to match %r{server d (iburst\s|)noselect} } end end puppetlabs-ntp-7.1.1/spec/acceptance/ntp_config_spec.rb0100644005276200011600000000216713207476405020206 0ustar00require 'spec_helper_acceptance' case fact('osfamily') when 'FreeBSD' line = '0.freebsd.pool.ntp.org maxpoll 9 iburst' when 'Debian' line = '0.debian.pool.ntp.org iburst' when 'RedHat' line = case fact('operatingsystem') when 'Fedora' '0.fedora.pool.ntp.org' else '0.centos.pool.ntp.org' end when 'Suse' line = '0.opensuse.pool.ntp.org' when 'Gentoo' line = '0.gentoo.pool.ntp.org' when 'Linux' case fact('operatingsystem') when 'ArchLinux' line = '0.arch.pool.ntp.org' when 'Gentoo' line = '0.gentoo.pool.ntp.org' end when 'Solaris' line = '0.pool.ntp.org' when 'AIX' line = '0.debian.pool.ntp.org iburst' end config = if fact('osfamily') == 'Solaris' '/etc/inet/ntp.conf' else '/etc/ntp.conf' end describe 'ntp::config class', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do it 'sets up ntp.conf' do apply_manifest(%( class { 'ntp': } ), catch_failures: true) end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match line } end end puppetlabs-ntp-7.1.1/spec/acceptance/ntp_install_spec.rb0100644005276200011600000000147713207476405020412 0ustar00require 'spec_helper_acceptance' case fact('osfamily') when 'FreeBSD' packagename = 'net/ntp' when 'Gentoo' packagename = 'net-misc/ntp' when 'Linux' case fact('operatingsystem') when 'ArchLinux' packagename = 'ntp' when 'Gentoo' packagename = 'net-misc/ntp' end when 'AIX' packagename = 'bos.net.tcp.client' when 'Solaris' case fact('kernelrelease') when '5.10' packagename = %w[SUNWntp4r SUNWntp4u] when '5.11' packagename = 'service/network/ntp' end end describe 'ntp::install class', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do it 'installs the package' do apply_manifest(%( class { 'ntp': } ), catch_failures: true) end Array(packagename).each do |package| describe package(package) do it { is_expected.to be_installed } end end end puppetlabs-ntp-7.1.1/spec/acceptance/ntp_parameters_spec.rb0100644005276200011600000001507313232340314021067 0ustar00require 'spec_helper_acceptance' case fact('osfamily') when 'FreeBSD' packagename = 'net/ntp' when 'Gentoo' packagename = 'net-misc/ntp' when 'Linux' case fact('operatingsystem') when 'ArchLinux' packagename = 'ntp' when 'Gentoo' packagename = 'net-misc/ntp' end when 'AIX' packagename = 'bos.net.tcp.client' when 'Solaris' case fact('kernelrelease') when '5.10' packagename = %w[SUNWntp4r SUNWntp4u] when '5.11' packagename = 'service/network/ntp' end else if fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12' 'ntpd' else 'ntp' end end keysfile = if fact('osfamily') == 'RedHat' '/etc/ntp/keys' elsif fact('osfamily') == 'Solaris' '/etc/inet/ntp.keys' else '/etc/ntp.keys' end config = if fact('osfamily') == 'Solaris' '/etc/inet/ntp.conf' else '/etc/ntp.conf' end describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do # FM-5470, this was added to reset failed count and work around puppet 3.x if (fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12') || (fact('operatingsystem') == 'Scientific' && fact('operatingsystemmajrelease') == '7') after :each do shell('systemctl reset-failed ntpd.service') end end it 'applies successfully' do pp = "class { 'ntp': }" apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to match(%r{error}i) end end describe 'config' do it 'sets the ntp.conf location' do pp = "class { 'ntp': config => '/etc/antp.conf' }" apply_manifest(pp, catch_failures: true) end describe file('/etc/antp.conf') do it { is_expected.to be_file } end end describe 'config_template' do before :all do modulepath = default['distmoduledir'] shell("mkdir -p #{modulepath}/test/templates") # Add spurious template logic to verify the use of the correct template rendering engine shell("echo '<% [1].each do |i| %>erbserver<%= i %><%end %>' >> #{modulepath}/test/templates/ntp.conf.erb") end it 'sets the ntp.conf erb template location' do pp = "class { 'ntp': config_template => 'test/ntp.conf.erb' }" apply_manifest(pp, catch_failures: true) end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match 'erbserver1' } end it 'sets the ntp.conf epp template location and the ntp.conf erb template location which should fail' do pp = "class { 'ntp': config_template => 'test/ntp.conf.erb', config_epp => 'test/ntp.conf.epp' }" expect(apply_manifest(pp, expect_failures: true).stderr).to match(%r{Cannot supply both config_epp and config_template}i) end end describe 'config_epp' do before :all do modulepath = default['distmoduledir'] shell("mkdir -p #{modulepath}/test/templates") # Add spurious template logic to verify the use of the correct template rendering engine shell("echo '<% [1].each |$i| { -%>eppserver<%= $i %><% } -%>' >> #{modulepath}/test/templates/ntp.conf.epp") end it 'sets the ntp.conf epp template location' do pp = "class { 'ntp': config_epp => 'test/ntp.conf.epp' }" apply_manifest(pp, catch_failures: true) end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match 'eppserver1' } end it 'sets the ntp.conf epp template location and the ntp.conf erb template location which should fail' do pp = "class { 'ntp': config_template => 'test/ntp.conf.erb', config_epp => 'test/ntp.conf.epp' }" expect(apply_manifest(pp, expect_failures: true).stderr).to match(%r{Cannot supply both config_epp and config_template}i) end end describe 'driftfile' do it 'sets the driftfile location' do pp = "class { 'ntp': driftfile => '/tmp/driftfile' }" apply_manifest(pp, catch_failures: true) end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match 'driftfile /tmp/driftfile' } end end describe 'keys' do pp = <<-MANIFEST class { 'ntp': keys_enable => true, keys_controlkey => 1, keys_requestkey => 1, keys_trusted => [ 1, 2 ], keys => [ '1 M AAAABBBB' ], } MANIFEST it 'enables the key parameters' do apply_manifest(pp, catch_failures: true) end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match "keys #{keysfile}" } its(:content) { is_expected.to match 'controlkey 1' } its(:content) { is_expected.to match 'requestkey 1' } its(:content) { is_expected.to match 'trustedkey 1 2' } end describe file(keysfile) do it { is_expected.to be_file } its(:content) { is_expected.to match '1 M AAAABBBB' } end end describe 'package' do pp = <<-MANIFEST class { 'ntp': package_ensure => present, package_name => #{Array(packagename).inspect}, } MANIFEST it 'installs the right package' do apply_manifest(pp, catch_failures: true) end Array(packagename).each do |package| describe package(package) do it { is_expected.to be_installed } end end end describe 'panic => 0' do pp = <<-MANIFEST class { 'ntp': panic => 0, } MANIFEST it 'disables the tinker panic setting' do apply_manifest(pp, catch_failures: true) end describe file(config.to_s) do its(:content) { is_expected.to match 'tinker panic 0' } end end describe 'panic => 1' do pp = <<-MANIFEST class { 'ntp': panic => 1, } MANIFEST it 'enables the tinker panic setting' do apply_manifest(pp, catch_failures: true) end describe file(config.to_s) do its(:content) { is_expected.to match 'tinker panic 1' } end end describe 'udlc' do it 'adds a udlc' do pp = "class { 'ntp': udlc => true }" apply_manifest(pp, catch_failures: true) end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match '127.127.1.0' } end end describe 'udlc_stratum' do it 'sets the stratum value when using udlc' do pp = "class { 'ntp': udlc => true, udlc_stratum => 10 }" apply_manifest(pp, catch_failures: true) end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match 'stratum 10' } end end end puppetlabs-ntp-7.1.1/spec/acceptance/ntp_service_spec.rb0100644005276200011600000000604213232340314020360 0ustar00require 'spec_helper_acceptance' require 'specinfra' case fact('osfamily') when 'RedHat', 'FreeBSD', 'Linux', 'Gentoo' servicename = 'ntpd' when 'Solaris' case fact('kernelrelease') when '5.10' servicename = 'network/ntp4' when '5.11' servicename = 'network/ntp' end when 'AIX' servicename = 'xntpd' else servicename = if fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12' 'ntpd' else 'ntp' end end shared_examples 'running' do describe service(servicename) do if !(fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12') it { is_expected.to be_running } if fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8' pending 'Should be enabled - Bug 760616 on Debian 8' else it { is_expected.to be_enabled } end else # HACK: until we either update SpecInfra or come up with alternative shell('service ntpd start') output = shell('service ntpd status') it { expect(output.stdout) =~ %r{Active\:\s+active\s+\(running\)} } it { expect(output.stdout) =~ %r{Loaded.*enabled\)$} } end end end describe 'service tests' do describe 'ntp::service class', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'with a basic test' do it 'sets up the service' do apply_manifest(%( class { 'ntp': } ), catch_failures: true) end it_behaves_like 'running' end describe 'service parameters' do pp = <<-MANIFEST class { 'ntp': service_enable => true, service_ensure => running, service_manage => true, service_name => '#{servicename}' } MANIFEST it 'starts the service' do apply_manifest(pp, catch_failures: true) end it_behaves_like 'running' end end describe 'service is unmanaged' do pp = <<-MANIFEST class { 'ntp': service_enable => false, service_ensure => stopped, service_manage => false, service_name => '#{servicename}' } MANIFEST it 'shouldnt stop the service' do apply_manifest(pp, catch_failures: true) end describe service(servicename) do if !(fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12') it { is_expected.to be_running } if fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8' pending 'Should be enabled - Bug 760616 on Debian 8' else it { is_expected.to be_enabled } end else # HACK: until we either update SpecInfra or come up with alternative let(:output) { shell('service ntpd status', acceptable_exit_codes: [0, 3]) } it 'is disabled' do expect(output.stdout) =~ %r{Loaded.*disabled\)$} end it 'is stopped' do expect(output.stdout) =~ %r{Active\:\s+inactive} end end end end end puppetlabs-ntp-7.1.1/spec/acceptance/preferred_servers_spec.rb0100644005276200011600000000155013232340314021565 0ustar00require 'spec_helper_acceptance' config = if fact('osfamily') == 'Solaris' '/etc/inet/ntp.conf' else '/etc/ntp.conf' end describe 'preferred servers', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do pp = <<-MANIFEST class { '::ntp': servers => ['a', 'b', 'c', 'd'], preferred_servers => ['c', 'd'], } MANIFEST it 'applies cleanly' do apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to match(%r{error}i) end end describe file(config.to_s) do it { is_expected.to be_file } its(:content) { is_expected.to match 'server a' } its(:content) { is_expected.to match 'server b' } its(:content) { is_expected.to match %r{server c (iburst\s|)prefer} } its(:content) { is_expected.to match %r{server d (iburst\s|)prefer} } end end puppetlabs-ntp-7.1.1/spec/acceptance/restrict_spec.rb0100644005276200011600000000120113232340314017666 0ustar00require 'spec_helper_acceptance' config = if fact('osfamily') == 'Solaris' '/etc/inet/ntp.conf' else '/etc/ntp.conf' end describe 'ntp class with restrict:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'when running' do let(:pp) { "class { 'ntp': restrict => ['test restrict']}" } it 'runs twice' do 2.times do apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to match(%r{error}i) end end end end describe file(config.to_s) do its(:content) { is_expected.to match('test restrict') } end end puppetlabs-ntp-7.1.1/spec/acceptance/statistics_spec.rb0100644005276200011600000000146113232340314020231 0ustar00require 'spec_helper_acceptance' config = if fact('osfamily') == 'Solaris' '/etc/inet/ntp.conf' else '/etc/ntp.conf' end describe 'ntp class with statistics:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'when successful' do let(:pp) { "class { 'ntp': statistics => ['loopstats'], disable_monitor => false}" } it 'runs twice' do 2.times do apply_manifest(pp, catch_failures: true) do |r| expect(r.stderr).not_to match(%r{error}i) end end end end describe file(config.to_s) do its(:content) { is_expected.to match('filegen loopstats file loopstats type day enable') } end describe file(config.to_s) do its(:content) { is_expected.to match('statsdir /var/log/ntpstats') } end end puppetlabs-ntp-7.1.1/spec/acceptance/unsupported_spec.rb0100644005276200011600000000047513232340314020433 0ustar00require 'spec_helper_acceptance' describe 'unsupported distributions and OSes', if: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do it 'fails' do pp = <<-MANIFEST class { 'ntp': } MANIFEST expect(apply_manifest(pp, expect_failures: true).stderr).to match(%r{is not supported on an}i) end end puppetlabs-ntp-7.1.1/spec/classes0040755005276200011600000000000013237313253014000 5ustar00puppetlabs-ntp-7.1.1/spec/classes/contains_spec.rb0100644005276200011600000000202613232340314017222 0ustar00# To check the correct dependancies are set up for NTP. require 'spec_helper' describe 'ntp' do let(:facts) { { is_virtual: false } } let :pre_condition do 'file { "foo.rb": ensure => present, path => "/etc/tmp", notify => Service["ntp"] }' end on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f| context "on #{os}" do let(:facts) do f.merge(super()) end it { is_expected.to compile.with_all_deps } describe 'Testing the dependancies between the classes' do it { is_expected.to contain_class('ntp::install') } it { is_expected.to contain_class('ntp::config') } it { is_expected.to contain_class('ntp::service') } it { is_expected.to contain_class('ntp::install').that_comes_before('Class[ntp::config]') } it { is_expected.to contain_class('ntp::service').that_subscribes_to('Class[ntp::config]') } it { is_expected.to contain_file('foo.rb').that_notifies('Service[ntp]') } end end end end puppetlabs-ntp-7.1.1/spec/classes/ntp_spec.rb0100644005276200011600000007013613232340314016214 0ustar00require 'spec_helper' on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f| describe 'ntp' do let(:facts) { { is_virtual: false } } context "on #{os}" do let(:facts) do f.merge(super()) end it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('ntp::install') } it { is_expected.to contain_class('ntp::config') } it { is_expected.to contain_class('ntp::service') } describe 'ntp::config' do it { is_expected.to contain_file('/etc/ntp.conf').with_owner('0') } it { is_expected.to contain_file('/etc/ntp.conf').with_group('0') } it { is_expected.to contain_file('/etc/ntp.conf').with_mode('0644') } if f[:os]['family'] == 'RedHat' it { is_expected.to contain_file('/etc/ntp/step-tickers').with_owner('0') } it { is_expected.to contain_file('/etc/ntp/step-tickers').with_group('0') } it { is_expected.to contain_file('/etc/ntp/step-tickers').with_mode('0644') } end if f[:os]['family'] == 'Suse' && f[:os]['release']['major'] == '12' it { is_expected.to contain_file('/var/run/ntp/servers-netconfig').with_ensure_absent } end describe 'allows template to be overridden with erb template' do let(:params) { { config_template: 'my_ntp/ntp.conf.erb' } } it { is_expected.to contain_file('/etc/ntp.conf').with_content(%r{erbserver1}) } end describe 'allows template to be overridden with epp template' do let(:params) { { config_epp: 'my_ntp/ntp.conf.epp' } } it { is_expected.to contain_file('/etc/ntp.conf').with_content(%r{eppserver1}) } end describe 'keys' do context 'when enabled' do let(:params) do { keys_enable: true, keys_trusted: [1, 2, 3], keys_controlkey: 2, keys_requestkey: 3, } end it { is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{trustedkey 1 2 3}) } it { is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{controlkey 2}) } it { is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{requestkey 3}) } end end context 'when disabled' do let(:params) do { keys_enable: false, keys_trusted: [1, 2, 3], keys_controlkey: 2, keys_requestkey: 3, } end it { is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{trustedkey 1 2 3}) } it { is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{controlkey 2}) } it { is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{requestkey 3}) } end describe 'preferred servers' do context 'when set' do let(:params) do { servers: %w[a b c d], preferred_servers: %w[a b], iburst_enable: false, } end it { is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server a prefer( maxpoll 9)?\nserver b prefer( maxpoll 9)?\nserver c( maxpoll 9)?\nserver d( maxpoll 9)?}) } end context 'when not set' do let(:params) do { servers: %w[a b c d], preferred_servers: [], } end it { is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{server a prefer}) } end end describe 'noselect servers' do context 'when set' do let(:params) do { servers: %w[a b c d], noselect_servers: %w[a b], iburst_enable: false, } end it { is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server a (maxpoll 9 )?noselect\nserver b (maxpoll 9 )?noselect\nserver c( maxpoll 9)?\nserver d( maxpoll 9)?}) } end context 'when not set' do let(:params) do { servers: %w[a b c d], noselect_servers: [], } end it { is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{server a noselect}) } end end describe 'specified interfaces' do context 'when set' do let(:params) do { servers: %w[a b c d], interfaces: ['127.0.0.1', 'a.b.c.d'], } end it { is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{interface ignore wildcard\ninterface listen 127.0.0.1\ninterface listen a.b.c.d}) } end context 'when not set' do let(:params) do { servers: %w[a b c d], } end it { is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{interface ignore wildcard}) } end end describe 'specified ignore interfaces' do context 'when set' do let(:params) do { interfaces: ['a.b.c.d'], interfaces_ignore: %w[wildcard ipv6], } end it { is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{interface ignore wildcard\ninterface ignore ipv6\ninterface listen a.b.c.d}) } end context 'when not set' do let(:params) do { interfaces: ['127.0.0.1'], servers: %w[a b c d], } end it { is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{interface ignore wildcard\ninterface listen 127.0.0.1}) } end end describe 'with parameter disable_auth' do context 'when set to true' do let(:params) do { disable_auth: true, } end it 'contains disable auth setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^disable auth\n}) end end context 'when set to false' do let(:params) do { disable_auth: false, } end it 'does not contain disable auth setting' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^disable auth\n}) end end end describe 'with parameter disable_dhclient' do context 'when set to true' do let(:params) do { disable_dhclient: true, } end it 'contains disable ntp-servers setting' do is_expected.to contain_augeas('disable ntp-servers in dhclient.conf') end it 'contains dhcp file' do is_expected.to contain_file('/var/lib/ntp/ntp.conf.dhcp').with_ensure('absent') end end context 'when set to false' do let(:params) do { disable_dhclient: false, } end it 'does not contain disable ntp-servers setting' do is_expected.not_to contain_augeas('disable ntp-servers in dhclient.conf') end it 'does not contain dhcp file' do is_expected.not_to contain_file('/var/lib/ntp/ntp.conf.dhcp').with_ensure('absent') end end end describe 'with parameter disable_kernel' do context 'when set to true' do let(:params) do { disable_kernel: true, } end it 'contains disable kernel setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^disable kernel\n}) end end context 'when set to false' do let(:params) do { disable_kernel: false, } end it 'does not contain disable kernel setting' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^disable kernel\n}) end end end describe 'with parameter disable_monitor' do context 'when default' do let(:params) do { } end it 'contains disable monitor setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^disable monitor\n}) end end context 'when set to true' do let(:params) do { disable_monitor: true, } end it 'contains disable monitor setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^disable monitor\n}) end end context 'when set to false' do let(:params) do { disable_monitor: false, } end it 'does not contain disable monitor setting' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^disable monitor\n}) end end end describe 'with parameter enable_mode7' do context 'when default' do let(:params) do { } end it 'does not contain enable mode7 setting' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^enable mode7\n}) end end context 'when set to true' do let(:params) do { enable_mode7: true, } end it 'contains enable mode7 setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^enable mode7\n}) end end context 'when set to false' do let(:params) do { enable_mode7: false, } end it 'does not contain enable mode7 setting' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^enable mode7\n}) end end end describe 'with parameter broadcastclient' do context 'when set to true' do let(:params) do { broadcastclient: true, } end it 'contains broadcastclient setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^broadcastclient\n}) end end context 'when set to false' do let(:params) do { broadcastclient: false, } end it 'does not contain broadcastclient setting' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^broadcastclient\n}) end end context 'when setting custom config_dir' do let(:params) do { keys_enable: true, config_dir: '/tmp/foo', keys_file: '/tmp/foo/ntp.keys', } end it 'contains custom config directory' do is_expected.to contain_file('/tmp/foo').with( 'ensure' => 'directory', 'owner' => '0', 'group' => '0', 'mode' => '0775', 'recurse' => 'false', ) end end context 'when manually setting conf file mode to 0777' do let(:params) do { config_file_mode: '0777', } end it 'contains file mode of 0777' do is_expected.to contain_file('/etc/ntp.conf').with_mode('0777') end end end context 'when choosing the default pool servers' do case f[:os]['family'] when 'RedHat' if f[:os]['name'] == 'Fedora' it 'uses the fedora ntp servers' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.fedora.pool.ntp.org}) end it do is_expected.to contain_file('/etc/ntp/step-tickers').with('content' => %r{\d.fedora.pool.ntp.org}) end else it 'uses the centos ntp servers' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.centos.pool.ntp.org}) end it do is_expected.to contain_file('/etc/ntp/step-tickers').with('content' => %r{\d.centos.pool.ntp.org}) end end when 'Debian' it 'uses the debian ntp servers' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.debian.pool.ntp.org iburst\n}) end when 'Suse' it 'uses the opensuse ntp servers' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.opensuse.pool.ntp.org}) end when 'FreeBSD' it 'uses the freebsd ntp servers' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.freebsd.pool.ntp.org iburst maxpoll 9}) end when 'Archlinux' it 'uses the Archlinux NTP servers' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{server \d.arch.pool.ntp.org}) end when 'Solaris', 'Gentoo' it 'uses the generic NTP pool servers' do is_expected.to contain_file('/etc/inet/ntp.conf').with('content' => %r{server \d.pool.ntp.org}) end else it { expect { catalogue }.to raise_error( %r{The ntp module is not supported on an unsupported based system.}, ) } end end describe 'slewalways' do context 'when absent' do if f[:kernel] == 'AIX' it 'on AIX does contain "slewalways no"' do is_expected.to contain_file('/etc/ntp.conf').with_content(%r{^slewalways no}) end else it 'on non-AIX does not contain a slewalways' do is_expected.to contain_file('/etc/ntp.conf').without_content(%r{^slewalways}) end end end context 'when "no"' do let(:params) do { slewalways: 'no', } end it 'does contain "slewalways no"' do is_expected.to contain_file('/etc/ntp.conf').with_content(%r{^slewalways no}) end end context 'when "yes"' do let(:params) do { slewalways: 'yes', } end it 'does contain "slewalways yes"' do is_expected.to contain_file('/etc/ntp.conf').with_content(%r{^slewalways yes}) end end end end describe 'ntp::install' do let(:params) { { package_ensure: 'present', package_name: ['ntp'], package_manage: true } } it { is_expected.to contain_package('ntp').with( ensure: 'present', ) } describe 'should allow package ensure to be overridden' do let(:params) { { package_ensure: 'latest', package_name: ['ntp'], package_manage: true } } it { is_expected.to contain_package('ntp').with_ensure('latest') } end describe 'should allow the package name to be overridden' do let(:params) { { package_ensure: 'present', package_name: ['hambaby'], package_manage: true } } it { is_expected.to contain_package('hambaby') } end describe 'should allow the package to be unmanaged' do let(:params) { { package_manage: false, package_name: ['ntp'] } } it { is_expected.not_to contain_package('ntp') } end end describe 'ntp::service' do let(:params) do { service_manage: true, service_enable: true, service_ensure: 'running', service_name: 'ntp', } end describe 'with defaults' do it { is_expected.to contain_service('ntp').with( enable: true, ensure: 'running', name: 'ntp', ) } end describe 'service_ensure' do describe 'when overridden' do let(:params) { { service_name: 'ntp', service_ensure: 'stopped' } } it { is_expected.to contain_service('ntp').with_ensure('stopped') } end end describe 'service_manage' do let(:params) do { service_manage: false, service_enable: true, service_ensure: 'running', service_name: 'ntpd', } end it 'when set to false' do is_expected.not_to contain_service('ntp').with('enable' => true, 'ensure' => 'running', 'name' => 'ntpd') end end end describe 'with parameter iburst_enable' do context 'when set to true' do let(:params) do { iburst_enable: true, } end it do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{iburst}) end end context 'when set to false' do let(:params) do { iburst_enable: false, } end it do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{iburst\n}) end end end describe 'with tinker parameter changed' do describe 'when set to false' do context 'when panic or stepout not overriden' do let(:params) do { tinker: false, } end it do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^tinker }) end end context 'when panic overriden' do let(:params) do { tinker: false, panic: 257, } end it do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^tinker }) end end context 'when stepout overriden' do let(:params) do { tinker: false, stepout: 5, } end it do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^tinker }) end end context 'when panic and stepout overriden' do let(:params) do { tinker: false, panic: 257, stepout: 5, } end it do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^tinker }) end end end describe 'when set to true' do context 'when only tinker set to true' do let(:params) do { tinker: true, } end it do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^tinker }) end end context 'when panic changed' do let(:params) do { tinker: true, panic: 257, } end it do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^tinker panic 257\n}) end end context 'when stepout changed' do let(:params) do { tinker: true, stepout: 5, } end it do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^tinker stepout 5\n}) end end context 'when panic and stepout changed' do let(:params) do { tinker: true, panic: 257, stepout: 5, } end it do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^tinker panic 257 stepout 5\n}) end end end end describe 'with parameters minpoll or maxpoll changed from default' do context 'when minpoll changed from default' do let(:params) do { minpoll: 6, } end it do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{minpoll 6}) end end context 'when maxpoll changed from default' do let(:params) do { maxpoll: 12, } end it do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{maxpoll 12\n}) end end context 'when minpoll and maxpoll changed from default simultaneously' do let(:params) do { minpoll: 6, maxpoll: 12, } end it do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{minpoll 6 maxpoll 12\n}) end end end describe 'with parameter leapfile' do context 'when set to true' do let(:params) do { servers: %w[a b c d], leapfile: '/etc/leap-seconds.3629404800', } end it 'contains leapfile setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^leapfile \/etc\/leap-seconds\.3629404800\n}) end end context 'when set to false' do let(:params) do { servers: %w[a b c d], } end it 'does not contain a leapfile line' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{leapfile }) end end end describe 'with parameter logfile' do context 'when set to true' do let(:params) do { servers: %w[a b c d], logfile: '/var/log/foobar.log', } end it 'contains logfile setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^logfile \/var\/log\/foobar\.log\n}) end end context 'when set to false' do let(:params) do { servers: %w[a b c d], } end it 'does not contain a logfile line' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{logfile }) end end end describe 'with parameter ntpsigndsocket' do context 'when set to true' do let(:params) do { servers: %w[a b c d], ntpsigndsocket: '/usr/local/samba/var/lib/ntp_signd', } end it 'contains ntpsigndsocket setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^ntpsigndsocket /usr/local/samba/var/lib/ntp_signd\n}) end end context 'when set to false' do let(:params) do { servers: %w[a b c d], } end it 'does not contain a ntpsigndsocket line' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{ntpsigndsocket }) end end end describe 'with parameter authprov' do context 'when set to true' do let(:params) do { servers: %w[a b c d], authprov: '/opt/novell/xad/lib64/libw32time.so 131072:4294967295 global', } end it 'contains authprov setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^authprov /opt/novell/xad/lib64/libw32time.so 131072:4294967295 global\n}) end end context 'when set to false' do let(:params) do { servers: %w[a b c d], } end it 'does not contain a authprov line' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{authprov }) end end end describe 'with parameter tos' do context 'when set to true' do let(:params) do { tos: true, } end it 'contains tos setting' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{^tos}) end end context 'when set to false' do let(:params) do { tos: false, } end it 'does not contain tos setting' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{^tos}) end end end describe 'pool' do context 'when empty' do let(:params) do { pool: [], } end it 'does not contain a pool line' do is_expected.to contain_file('/etc/ntp.conf').without_content(%r{^pool}) end end context 'when set' do let(:params) do { pool: %w[foo bar], } end it 'contains the pool lines - expectation one' do is_expected.to contain_file('/etc/ntp.conf').with_content(%r{pool foo}) end it 'contains the pool lines - expectation two' do is_expected.to contain_file('/etc/ntp.conf').with_content(%r{pool bar}) end end end describe 'peers' do context 'when empty' do let(:params) do { peers: [], } end it 'does not contain a peer line' do is_expected.to contain_file('/etc/ntp.conf').without_content(%r{^peer}) end end context 'when set' do let(:params) do { peers: %w[foo bar], } end it 'contains the peer lines - expectation one' do is_expected.to contain_file('/etc/ntp.conf').with_content(%r{peer foo}) end it 'contains the peer lines - expectation two' do is_expected.to contain_file('/etc/ntp.conf').with_content(%r{peer bar}) end end end describe 'for virtual machines' do let :facts do super().merge(is_virtual: true) end it 'does not use local clock as a time source' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{server.*127.127.1.0.*fudge.*127.127.1.0 stratum 10}) end it 'allows large clock skews' do is_expected.to contain_file('/etc/ntp.conf').with('content' => %r{tinker panic 0}) end end describe 'for physical machines' do let :facts do super().merge(is_virtual: false) end it 'disallows large clock skews' do is_expected.not_to contain_file('/etc/ntp.conf').with('content' => %r{tinker panic 0}) end end end end end puppetlabs-ntp-7.1.1/spec/fixtures0040755005276200011600000000000013237313253014214 5ustar00puppetlabs-ntp-7.1.1/spec/fixtures/my_ntp0040755005276200011600000000000013237313253015522 5ustar00puppetlabs-ntp-7.1.1/spec/fixtures/my_ntp/templates0040755005276200011600000000000013237313253017520 5ustar00puppetlabs-ntp-7.1.1/spec/fixtures/my_ntp/templates/ntp.conf.epp0100644005276200011600000000010013207476405022024 0ustar00# EPP template <% [1].each |$i| { -%>eppserver<%= $i %><% } -%> puppetlabs-ntp-7.1.1/spec/fixtures/my_ntp/templates/ntp.conf.erb0100644005276200011600000000007613207476405022024 0ustar00# ERB template <% [1].each do |i| %>erbserver<%= i %><%end %> puppetlabs-ntp-7.1.1/spec/spec_helper.rb0100644005276200011600000000144313232340314015230 0ustar00require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' include RspecPuppetFacts default_facts = { puppetversion: Puppet.version, facterversion: Facter.version, } default_facts_path = File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')) default_module_facts_path = File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')) if File.exist?(default_facts_path) && File.readable?(default_facts_path) default_facts.merge!(YAML.safe_load(File.read(default_facts_path))) end if File.exist?(default_module_facts_path) && File.readable?(default_module_facts_path) default_facts.merge!(YAML.safe_load(File.read(default_module_facts_path))) end RSpec.configure do |c| c.default_facts = default_facts end require 'spec_helper_local' puppetlabs-ntp-7.1.1/spec/spec_helper_acceptance.rb0100644005276200011600000000234213207476405017412 0ustar00require 'beaker-rspec' require 'beaker/puppet_install_helper' require 'beaker/module_install_helper' UNSUPPORTED_PLATFORMS = %w[windows Darwin].freeze run_puppet_install_helper install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i install_module_on(hosts) install_module_dependencies_on(hosts) unless ENV['RS_PROVISION'] == 'no' || ENV['BEAKER_provision'] == 'no' hosts.each do |host| # Need to disable update of ntp servers from DHCP, as subsequent restart of ntp causes test failures if fact_on(host, 'osfamily') == 'Debian' on host, 'dpkg-divert --divert /etc/dhcp-ntp.bak --local --rename --add /etc/dhcp/dhclient-exit-hooks.d/ntp' on host, 'dpkg-divert --divert /etc/dhcp3-ntp.bak --local --rename --add /etc/dhcp3/dhclient-exit-hooks.d/ntp' elsif fact_on(host, 'osfamily') == 'RedHat' on host, 'echo "PEERNTP=no" >> /etc/sysconfig/network' end end end RSpec.configure do |c| # Project root proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) # Readable test descriptions c.formatter = :documentation # Configure all nodes in nodeset c.before :suite do hosts.each do |host| copy_module_to(host, source: proj_root, module_name: 'ntp') end end end puppetlabs-ntp-7.1.1/spec/spec_helper_local.rb0100644005276200011600000000006613207476405016417 0ustar00require 'rspec-puppet-facts' include RspecPuppetFacts puppetlabs-ntp-7.1.1/templates0040755005276200011600000000000013237313253013407 5ustar00puppetlabs-ntp-7.1.1/templates/keys.epp0100644005276200011600000000012713207476405015152 0ustar00# THIS FILE IS MANAGED BY PUPPET <% $ntp::keys.each |$key| { -%> <%= $key %> <% } -%> puppetlabs-ntp-7.1.1/templates/ntp.conf.epp0100644005276200011600000001015413232340314015710 0ustar00# ntp.conf: Managed by puppet. # <% if $ntp::_tinker and ($ntp::_panic or $ntp::stepout) {-%> # Enable next tinker options: # panic - keep ntpd from panicking in the event of a large clock skew # when a VM guest is suspended and resumed; # stepout - allow ntpd change offset faster tinker<% if $ntp::_panic { %> panic <%= $ntp::_panic %><% } %><%if $ntp::stepout { %> stepout <%=$ntp::stepout %><% } %> <% } -%> <%# -%> <% if $ntp::disable_monitor {-%> disable monitor <% } -%> statsdir <%= $ntp::statsdir %> <% unless $ntp::statistics.empty {-%> # Build requested statistics files statistics <%= $ntp::statistics.join(' ') %> <% $ntp::statistics.each |$statistic| {-%> filegen <%= $statistic %> file <%= $statistic %> type day enable <% } -%> <% } -%> <% if $ntp::disable_auth {-%> disable auth <% } -%> <% if $ntp::disable_kernel {-%> disable kernel <% } -%> <% if $ntp::enable_mode7 {-%> enable mode7 <% } -%> <%# -%> <% unless $ntp::restrict.empty {-%> # Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. <% $ntp::restrict.each |$restrict| {-%> restrict <%= $restrict %> <% } -%> <% } -%> <%# -%> <% unless $ntp::interfaces.empty {-%> <% if $ntp::interfaces_ignore.empty {-%> # Ignore wildcard interface and only listen on the following specified # interfaces interface ignore wildcard <% } else {-%> <% $ntp::interfaces_ignore.each |$interface| {-%> interface ignore <%= $interface %> <% } -%> <% } -%> <% $ntp::interfaces.each |$interface| {-%> interface listen <%= $interface %> <% } -%> <% } -%> <%# -%> <% if $ntp::broadcastclient {-%> broadcastclient <% } -%> # Set up servers for ntpd with next options: # server - IP address or DNS name of upstream NTP server # iburst - allow send sync packages faster if upstream unavailable # prefer - select preferrable server # minpoll - set minimal update frequency # maxpoll - set maximal update frequency # noselect - do not sync with this server <% $ntp::servers.each |$server| {-%> server <%= $server %><% if $ntp::iburst_enable == true {%> iburst<% } %><% if ($ntp::preferred_servers).member($server) { %> prefer<% } %><% if $ntp::minpoll { %> minpoll <%= $ntp::minpoll %><% } %><% if $ntp::maxpoll { %> maxpoll <%= $ntp::maxpoll %><% } %><% if ($ntp::noselect_servers).member($server) { %> noselect<% } %> <% } -%> <%# -%> <% if $ntp::udlc {-%> # Undisciplined Local Clock. This is a fake driver intended for backup # and when no outside source of synchronized time is available. server 127.127.1.0 fudge 127.127.1.0 stratum <%= $ntp::udlc_stratum %> restrict 127.127.1.0 <% } -%> # Driftfile. driftfile <%= $ntp::driftfile %> <%# -%> <% if $ntp::logfile {-%> # Logfile logfile <%= $ntp::logfile %> <% } -%> <%# -%> <% if $ntp::ntpsigndsocket {-%> # Enable signed packets ntpsigndsocket <%= $ntp::ntpsigndsocket %> <% } -%> <%# -%> <% unless $ntp::peers.empty {-%> # Peers <% $ntp::peers.each |$peer| {-%> peer <%= $peer %> <% } -%> <% } -%> <% unless $ntp::pool.empty {-%> # Pool <% $ntp::pool.each |$pool_srv| {-%> pool <%= $pool_srv %> <% } -%> <% } -%> <%# -%> <% if $ntp::keys_enable {-%> keys <%= $ntp::keys_file %> <% unless $ntp::keys_trusted.empty {-%> trustedkey <%= $ntp::keys_trusted.join(' ') %> <% } -%> <% if $ntp::keys_requestkey != '' {-%> requestkey <%= $ntp::keys_requestkey %> <% } -%> <% if $ntp::keys_controlkey != '' {-%> controlkey <%= $ntp::keys_controlkey %> <% } -%> <% } -%> <% $ntp::fudge.each |$entry| {-%> fudge <%= $entry %> <% } -%> <%# -%> <% if $ntp::leapfile {-%> # Leapfile leapfile <%= $ntp::leapfile %> <% } -%> <%# -%> <% if $ntp::tos {-%> tos <% if $ntp::tos_minclock {-%> minclock <%= $ntp::tos_minclock %><% } %> <% if $ntp::tos_maxclock {-%> maxclock <%= $ntp::tos_maxclock %><% } %> <% if $ntp::tos_minsane {-%> minsane <%= $ntp::tos_minsane %><% } %> <% if $ntp::tos_floor {-%> floor <%= $ntp::tos_floor %><% } %> <% if $ntp::tos_ceiling {-%> ceiling <%= $ntp::tos_ceiling %><% } %> <% if $ntp::tos_cohort {-%> cohort <%= $ntp::tos_cohort %><% } %> <% } %> <%# -%> <% if $ntp::authprov {-%> authprov <%= $ntp::authprov %> <% } -%> <% if $ntp::slewalways {-%> slewalways <%= $ntp::slewalways -%> <% } -%> puppetlabs-ntp-7.1.1/templates/step-tickers.epp0100644005276200011600000000044513207476405016617 0ustar00# List of NTP servers used by the ntpdate service. <% $ntp::servers.each |$server| { -%> <% if $ntp::noselect_servers.member($server) { -%> # <%= $server %> <% } elsif $ntp::preferred_servers.size() == 0 or $ntp::preferred_servers.member($server) { -%> <%= $server %> <% } -%> <% } -%> puppetlabs-ntp-7.1.1/types0040755005276200011600000000000013237313253012555 5ustar00puppetlabs-ntp-7.1.1/types/key_id.pp0100644005276200011600000000026013207476405014442 0ustar00# See http://doc.ntp.org/4.2.6/authopt.html#controlkey for documentation # Alternatively: type Ntp::Key_id = Variant[Integer, Pattern['']] type Ntp::Key_id = Integer[1, 65534] puppetlabs-ntp-7.1.1/types/poll_interval.pp0100644005276200011600000000027013207476405016051 0ustar00# See http://doc.ntp.org/4.2.6/clockopt.html#server for documentation # Alternatively: type Ntp::Poll_interval = Variant[Integer, Pattern['']] type Ntp::Poll_interval = Integer[4, 17]