Commit bbc109bf authored by Sebastien Badia's avatar Sebastien Badia

New upstream version 7.2.0

parent 222c3c44
# 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).
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
## [7.2.0](https://github.com/puppetlabs/puppetlabs-ntp/tree/7.2.0) (2018-07-03)
[Full Changelog](https://github.com/puppetlabs/puppetlabs-ntp/compare/7.1.1...7.2.0)
### Changed
- \(FM-6955\) Remove unsupported OS: F24, F25, Debian 7 [\#462](https://github.com/puppetlabs/puppetlabs-ntp/pull/462) ([david22swan](https://github.com/david22swan))
### Added
- Add SLES 15 hiera data [\#472](https://github.com/puppetlabs/puppetlabs-ntp/pull/472) ([mattiasgiese](https://github.com/mattiasgiese))
- \(FM-7038\) Add support for Debian 9 [\#470](https://github.com/puppetlabs/puppetlabs-ntp/pull/470) ([david22swan](https://github.com/david22swan))
- add tos\_orphan parameter [\#452](https://github.com/puppetlabs/puppetlabs-ntp/pull/452) ([disklord](https://github.com/disklord))
### Fixed
- \(MODULES-6363\) fix disabling dhclient on redhat-derivatives [\#439](https://github.com/puppetlabs/puppetlabs-ntp/pull/439) ([sudodevnull](https://github.com/sudodevnull))
## 7.1.1
### Summary
This release includes updates Japanese translations.
This release includes updated Japanese translations.
### Added
- Updating translations for readmes/README_ja_JP.md
## Supported Release 7.1.0
## 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.
......@@ -26,7 +43,7 @@ This release uses the PDK convert functionality which in return makes the module
- 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
## 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.
......@@ -34,14 +51,14 @@ Hiera 5 only works with Puppet 4.9.4 and above, we have bumped the Puppet requir
- 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
## 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
## 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.
......@@ -51,7 +68,7 @@ This release is to both update the modules code so that it matches the set stand
#### Changed
- All ruby code within module has been altered to match standards.
## Supported Release 6.3.0
## 6.3.0
### Summary
This is a feature release with some bugfixes and updated Japanese translations, too.
......@@ -71,7 +88,7 @@ This is a feature release with some bugfixes and updated Japanese translations,
- Whitespace issue in ntp.conf.epp with `tos`
- Permissions on keys file
## Supported Release 6.2.0
## 6.2.0
### Summary
This is a small minor release that adds the `pool` parameter and revises some Japanese translations.
......@@ -81,7 +98,7 @@ This is a small minor release that adds the `pool` parameter and revises some Ja
#### Fixed
- Japanese translations for the README
## Supported Release 6.1.0
## 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.
......@@ -104,7 +121,7 @@ This release adds support for internationalization of the module. It also contai
- (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
##s 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.
......@@ -120,7 +137,7 @@ If you're still running Puppet 3, remain on the latest puppetlabs-ntp 4.x releas
* [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
## 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.
......@@ -152,12 +169,12 @@ A large release with many new features. Multiple additions to parameters and wor
- Converted license string to SPDX format
- Removed ruby 1.8.7 and puppet 2.7 from travis-ci jobs
## Supported Release 4.1.2
## 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
## 4.1.1
### Summary
This is a bugfix release to address security vulnerability CVE-2013-5211.
......@@ -424,3 +441,6 @@ Configuration directives that might possibly be affected:
##2011-06-16 Jeff McCune <jeff@puppetlabs.com> - 0.0.3
* Initial release under puppetlabs
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
......@@ -28,11 +28,12 @@ group :development do
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 "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
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
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
......@@ -49,73 +50,24 @@ 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
# variables
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
gems['facter'] = location_for(facter_version) if facter_version
gems['hiera'] = location_for(hiera_version) if hiera_version
# 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 Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
# 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]
gems['win32-service'] = ['0.8.8', require: false]
end
gems.each do |gem_name, gem_params|
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any?
def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = "puppetlabs" || JSON.load(File.read('metadata.json'))['author']
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator user:#{returnVal}"
returnVal
end
def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
end
def changelog_future_release
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = JSON.load(File.read('metadata.json'))['version']
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator future_release:#{returnVal}"
returnVal
end
PuppetLint.configuration.send('disable_relative')
if Bundler.rubygems.find_name('github_changelog_generator').any?
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
config.user = "#{changelog_user}"
config.project = "#{changelog_project}"
config.future_release = "#{changelog_future_release}"
config.exclude_labels = ['maintenance']
config.header = "# Change log\n\nAll 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)."
config.add_pr_wo_labels = true
config.issues = false
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
config.configure_sections = {
"Changed" => {
"prefix" => "### Changed",
"labels" => ["backwards-incompatible"],
},
"Added" => {
"prefix" => "### Added",
"labels" => ["feature", "enhancement"],
},
"Fixed" => {
"prefix" => "### Fixed",
"labels" => ["bugfix"],
},
}
end
else
desc 'Generate a Changelog from GitHub'
task :changelog do
raise <<EOM
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
Please manually add it to your .sync.yml for now, and run `pdk update`:
---
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
EOM
end
end
{
"CHANGELOG.md": "9c089ebe50404239a6f52d32245bc273",
"CHANGELOG.md": "1279ac7231314793926bfc44b42ac7ac",
"CONTRIBUTING.md": "4d17f3c942e7c93d1577cc4438a231e4",
"Gemfile": "47f2bb73e730d42a921e7bca4449f5aa",
"Gemfile": "ad6397591cc7b61bf6642a622fe0bc7b",
"HISTORY.md": "0bc8da09607dcac3227f3e27bfb30108",
"LICENSE": "3b83ef96387f14655fc854ddc3c6bd57",
"MAINTAINERS.md": "9230f8b03e0d9dbb08812838574be9d3",
"NOTICE": "c9a9561a16eac9f7304d12680d9df29f",
"README.md": "144e8701ef9da17267525340e6bd6cec",
"Rakefile": "df4172642435e770c27019d9d15d59bd",
"README.md": "588f111e9a0d45c8f06dfe11a869dca3",
"REFERENCE.md": "6a0d27cecd0ce5a5892e58fc2eb3cae7",
"Rakefile": "4e5b2a2af33633d63408eda5419a30f6",
"data/AIX-family.yaml": "9ebab7ca637c380fa75e7dff0a694795",
"data/Amazon.yaml": "592c462c2449a2aa36067b32a5c9b559",
"data/Archlinux-family.yaml": "37df45c9174facb6699d68db292098a6",
......@@ -18,20 +20,21 @@
"data/RedHat-family.yaml": "37faf7710394c7f26bfd3c2cce35871a",
"data/SLES-10.yaml": "b1ffac58b18589235bbb546dda98380f",
"data/SLES-12.yaml": "0df8a5b62510ce8a86d2040f238b5f76",
"data/SLES-15.yaml": "0df8a5b62510ce8a86d2040f238b5f76",
"data/Solaris-10.yaml": "5fd9c7acbb4b4d4ad337f310d13734f9",
"data/Solaris-11.yaml": "c314fbdb06a00722974146b10dc8ba00",
"data/Suse-family.yaml": "b9ddb837225182db53d04b8f3aae2703",
"data/common.yaml": "71f89ac0948987cfaae150b775b163bb",
"data/common.yaml": "367555c3eec61b47c898e959dec06ab7",
"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",
"manifests/config.pp": "ce91f0df43742fa70d20df5a6a471afa",
"manifests/init.pp": "d52a6bfcb111bebd7222c665e012cc78",
"manifests/install.pp": "fd145448707fc7c97b4eae9a005d6700",
"manifests/service.pp": "bd4724cce39df728678cd569793d44b4",
"metadata.json": "f9bcdb407b294c65ba2f85e779183a97",
"readmes/README_ja_JP.md": "7e6c28fcf29c5a2c170d289edca7f853",
"spec/acceptance/class_spec.rb": "5db9f816c7eb14359a5ecce4f791d45e",
"spec/acceptance/disable_monitoring_spec.rb": "38f0e4d832bb07d112ad70ba48abbcca",
......@@ -44,22 +47,23 @@
"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_install_spec.rb": "1acfed2aafebd5d3bdb908b7d6024df6",
"spec/acceptance/ntp_parameters_spec.rb": "5bc481d37515fe88c64810b935ccd9a3",
"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/classes/ntp_spec.rb": "dd77fcf18e8f11cafd1f86a0cea9a566",
"spec/default_facts.yml": "4de3cb611af6981a6d22bc77d7dd6f6f",
"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.rb": "239eb0cfd04f81bb12de2121fc0dacc8",
"spec/spec_helper_acceptance.rb": "de5821853d8b37ba37a626e23edf8dc3",
"spec/spec_helper_local.rb": "35d201e4b56adf60407d84c2a231b9ff",
"templates/keys.epp": "4931f55f1669138166cadd70b931ddca",
"templates/ntp.conf.epp": "d892f9dfd38fa234505373df7e085a02",
"templates/ntp.conf.epp": "33e0e3367205d3b7a2c29bbf4dae1ad4",
"templates/step-tickers.epp": "1a20cfd4c636ce4f696b23419d6c9ace",
"types/key_id.pp": "e01c91e0839c5684495a8ea70f2399e5",
"types/poll_interval.pp": "6a2190db7dcfbf3a7be0f659b6fd287d"
......
ntp::service_name: ntpd
ntp::service_provider: systemd
......@@ -59,6 +59,7 @@ ntp::tos_floor: 1
ntp::tos_maxclock: 6
ntp::tos_minclock: 3
ntp::tos_minsane: 1
ntp::tos_orphan: ~
ntp::tos: false
ntp::udlc_stratum: 10
ntp::udlc: false
# @summary
# This class handles the configuration file.
#
# @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.
......@@ -94,5 +97,10 @@ class ntp::config {
file { '/var/lib/ntp/ntp.conf.dhcp':
ensure => absent,
}
#remove dhclient ntp script which modifies ntp.conf on RHEL and Amazon Linux
file { '/etc/dhcp/dhclient.d/ntp.sh':
ensure => absent,
}
}
}
......@@ -109,6 +109,10 @@
# @param peers
# List of NTP servers with which to synchronise the local clock.
#
# @param tos_orphan
# Enables Orphan mode for peer group
# Value: Should be set to 2 more than the worst-case externally-reachable source's stratum.
#
# @param pool
# List of NTP server pools with which to synchronise the local clock.
#
......@@ -176,6 +180,9 @@
# @param tos_minclock
# Specifies the minclock tos option. Default value: 3.
#
# @param tos_maxclock
# Specifies the maxclock tos option. Default value: 6.
#
# @param tos_minsane
# Specifies the minsane tos option. Default value: 1.
#
......@@ -255,6 +262,7 @@ class ntp (
Optional[Integer[1]] $tos_minsane,
Optional[Integer[1]] $tos_floor,
Optional[Integer[1]] $tos_ceiling,
Optional[Integer[1]] $tos_orphan,
Variant[Boolean, Integer[0,1]] $tos_cohort,
Boolean $udlc,
Optional[Integer[1,15]] $udlc_stratum,
......
# @summary
# This class handles ntp packages.
#
# @api private
# This class handles ntp packages. Avoid modifying private classes.
#
class ntp::install {
if $ntp::package_manage {
......
# @summary
# This class handles the ntp service.
#
# @api private
# This class handles the ntp service. Avoid modifying private classes.
#
class ntp::service {
if $ntp::service_manage == true {
......
{
"name": "puppetlabs-ntp",
"version": "7.1.1",
"version": "7.2.0",
"author": "Puppet Inc",
"summary": "Installs, configures, and manages the NTP service.",
"license": "Apache-2.0",
......@@ -42,18 +42,10 @@
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "Fedora",
"operatingsystemrelease": [
"24",
"25"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
......@@ -64,8 +56,8 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"7",
"8"
"8",
"9"
]
},
{
......@@ -109,6 +101,7 @@
}
],
"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"
"template-url": "https://github.com/puppetlabs/pdk-templates",
"template-ref": "heads/master-0-gc87eee3",
"pdk-version": "1.7.0.pre (2)"
}
......@@ -17,7 +17,7 @@ when 'AIX'
when 'Solaris'
case fact('kernelrelease')
when '5.10'
packagename = %w[SUNWntp4r SUNWntp4u]
packagename = ['SUNWntp4r', 'SUNWntp4u']
when '5.11'
packagename = 'service/network/ntp'
end
......
......@@ -17,7 +17,7 @@ when 'AIX'
when 'Solaris'
case fact('kernelrelease')
when '5.10'
packagename = %w[SUNWntp4r SUNWntp4u]
packagename = ['SUNWntp4r', 'SUNWntp4u']
when '5.11'
packagename = 'service/network/ntp'
end
......
......@@ -90,8 +90,8 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set' do
let(:params) do
{
servers: %w[a b c d],
preferred_servers: %w[a b],
servers: ['a', 'b', 'c', 'd'],
preferred_servers: ['a', 'b'],
iburst_enable: false,
}
end
......@@ -103,7 +103,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when not set' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
preferred_servers: [],
}
end
......@@ -118,8 +118,8 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set' do
let(:params) do
{
servers: %w[a b c d],
noselect_servers: %w[a b],
servers: ['a', 'b', 'c', 'd'],
noselect_servers: ['a', 'b'],
iburst_enable: false,
}
end
......@@ -131,7 +131,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when not set' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
noselect_servers: [],
}
end
......@@ -145,7 +145,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
interfaces: ['127.0.0.1', 'a.b.c.d'],
}
end
......@@ -157,7 +157,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when not set' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
}
end
......@@ -172,7 +172,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
let(:params) do
{
interfaces: ['a.b.c.d'],
interfaces_ignore: %w[wildcard ipv6],
interfaces_ignore: ['wildcard', 'ipv6'],
}
end
......@@ -184,7 +184,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
let(:params) do
{
interfaces: ['127.0.0.1'],
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
}
end
......@@ -233,6 +233,9 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
it 'contains dhcp file' do
is_expected.to contain_file('/var/lib/ntp/ntp.conf.dhcp').with_ensure('absent')
end
it 'contains ntp.sh file' do
is_expected.to contain_file('/etc/dhcp/dhclient.d/ntp.sh').with_ensure('absent')
end
end
context 'when set to false' do
let(:params) do
......@@ -395,21 +398,12 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
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})
......@@ -730,7 +724,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set to true' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
leapfile: '/etc/leap-seconds.3629404800',
}
end
......@@ -743,7 +737,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set to false' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
}
end
......@@ -757,7 +751,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set to true' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
logfile: '/var/log/foobar.log',
}
end
......@@ -770,7 +764,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set to false' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
}
end
......@@ -784,7 +778,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set to true' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
ntpsigndsocket: '/usr/local/samba/var/lib/ntp_signd',
}
end
......@@ -797,7 +791,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set to false' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
}
end
......@@ -811,7 +805,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set to true' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
authprov: '/opt/novell/xad/lib64/libw32time.so 131072:4294967295 global',
}
end
......@@ -824,7 +818,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set to false' do
let(:params) do
{
servers: %w[a b c d],
servers: ['a', 'b', 'c', 'd'],
}
end
......@@ -876,7 +870,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set' do
let(:params) do
{
pool: %w[foo bar],
pool: ['foo', 'bar'],
}
end
......@@ -905,7 +899,7 @@ on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
context 'when set' do
let(:params) do
{
peers: %w[foo bar],
peers: ['foo', 'bar'],
}
end
......
# Use default_module_facts.yml for module specific facts.
#
# Facts specified here will override the values provided by rspec-puppet-facts.
---
concat_basedir: "/tmp"
ipaddress: "172.16.254.254"
is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
begin
require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb'))
rescue LoadError => loaderror
warn "Could not require spec_helper_local: #{loaderror.message}"
end
include RspecPuppetFacts
default_facts = {
......@@ -20,5 +28,18 @@ end