Commit 222c3c44 authored by Sebastien Badia's avatar Sebastien Badia

New upstream version 7.1.1

parent f78b5e86
......@@ -3,6 +3,29 @@
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.
......
#This file is generated by ModuleSync, do not edit.
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
source 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
# Determines what type of gem is requested based on place_or_version.
def gem_type(place_or_version)
if place_or_version =~ /^git:/
if place_or_version =~ %r{\Agit[:@]}
:git
elsif place_or_version =~ /^file:/
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
:file
else
:gem
end
end
# Find a location or specific version for a gem. place_or_version can be a
# version, which is most often used. It can also be git, which is specified as
# `git://somewhere.git#branch`. You can also use a file source location, which
# is specified as `file://some/location/on/disk`.
def location_for(place_or_version, fake_version = nil)
if place_or_version =~ /^(git[:@][^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
elsif place_or_version =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
else
[place_or_version, { :require => false }]
end
end
# Used for gem conditionals
supports_windows = false
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}"
minor_version = ruby_version_segments[0..1].join('.')
group :development do
gem "puppet-module-posix-default-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-posix-dev-r#{minor_version}", :require => false, :platforms => "ruby"
gem "puppet-module-win-dev-r#{minor_version}", '0.0.7', :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
gem "json_pure", '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
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 "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')
gem "beaker-pe", :require => false
gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION'])
gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'])
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
gem "puppet-blacksmith", '~> 3.4', :require => false
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
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
puppet_version = ENV['PUPPET_GEM_VERSION']
puppet_type = gem_type(puppet_version)
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']
# Only explicitly specify Facter/Hiera if a version has been specified.
# Otherwise it can lead to strange bundler behavior. If you are seeing weird
# gem resolution behavior, try setting `DEBUG_RESOLVER` environment variable
# to `1` and then run bundle install.
gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION']
gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if 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)
# Evaluate Gemfile.local if it exists
if File.exists? "#{__FILE__}.local"
eval(File.read("#{__FILE__}.local"), binding)
# 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
# Evaluate ~/.gemfile if it exists
if File.exists?(File.join(Dir.home, '.gemfile'))
eval(File.read(File.join(Dir.home, '.gemfile')), binding)
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
# vim:ft=ruby
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
Puppet Module - puppetlabs-ntp
Copyright 2017 Puppet, Inc.
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.
......
......@@ -501,6 +501,16 @@ 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.
......
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
desc 'Generate pooler nodesets'
task :gen_nodeset do
require 'beaker-hostgenerator'
require 'securerandom'
require 'fileutils'
agent_target = ENV['TEST_TARGET']
if ! agent_target
STDERR.puts 'TEST_TARGET environment variable is not set'
STDERR.puts 'setting to default value of "redhat-64default."'
agent_target = 'redhat-64default.'
end
master_target = ENV['MASTER_TEST_TARGET']
if ! master_target
STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
STDERR.puts 'setting to default value of "redhat7-64mdcl"'
master_target = 'redhat7-64mdcl'
end
targets = "#{master_target}-#{agent_target}"
cli = BeakerHostGenerator::CLI.new([targets])
nodeset_dir = "tmp/nodesets"
nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
FileUtils.mkdir_p(nodeset_dir)
File.open(nodeset, 'w') do |fh|
fh.print(cli.execute)
end
puts nodeset
end
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks'
{
"CHANGELOG.md": "0de05af2c8b889be1cfdd4c2af0fe3a0",
"CHANGELOG.md": "9c089ebe50404239a6f52d32245bc273",
"CONTRIBUTING.md": "4d17f3c942e7c93d1577cc4438a231e4",
"Gemfile": "99e30e5e231f5f2b460b812c37d084f7",
"Gemfile": "47f2bb73e730d42a921e7bca4449f5aa",
"LICENSE": "3b83ef96387f14655fc854ddc3c6bd57",
"MAINTAINERS.md": "9230f8b03e0d9dbb08812838574be9d3",
"NOTICE": "13ee3b5d8d5be71cb3de0c81a6379694",
"README.md": "4f17bb2ee813fb6c27caeacb23bd5f36",
"Rakefile": "3851f083966b9bbd6d46e50dba5aa52a",
"data/AIX.yaml": "6aecae27293a7fa681953b3a99eec5aa",
"NOTICE": "c9a9561a16eac9f7304d12680d9df29f",
"README.md": "144e8701ef9da17267525340e6bd6cec",
"Rakefile": "df4172642435e770c27019d9d15d59bd",
"data/AIX-family.yaml": "9ebab7ca637c380fa75e7dff0a694795",
"data/Amazon.yaml": "592c462c2449a2aa36067b32a5c9b559",
"data/Archlinux.yaml": "37df45c9174facb6699d68db292098a6",
"data/Debian.yaml": "9c482d7062f1dd2e073b510d25ea07d9",
"data/Archlinux-family.yaml": "37df45c9174facb6699d68db292098a6",
"data/Debian-family.yaml": "9c482d7062f1dd2e073b510d25ea07d9",
"data/Fedora.yaml": "7e28c6fea7fe7e41b39bfbb8952138f9",
"data/FreeBSD.yaml": "a8f4dc99823ca81a2c408b9316184468",
"data/Gentoo.yaml": "4cbfa6ca120ea1861270d523d97018a1",
"data/FreeBSD-family.yaml": "a8f4dc99823ca81a2c408b9316184468",
"data/Gentoo-family.yaml": "4cbfa6ca120ea1861270d523d97018a1",
"data/OpenSuSE.yaml": "0df8a5b62510ce8a86d2040f238b5f76",
"data/RedHat.yaml": "37faf7710394c7f26bfd3c2cce35871a",
"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.yaml": "b9ddb837225182db53d04b8f3aae2703",
"data/common.yaml": "30af34568e2f7ea3019053b0b84d685d",
"data/Suse-family.yaml": "b9ddb837225182db53d04b8f3aae2703",
"data/common.yaml": "71f89ac0948987cfaae150b775b163bb",
"examples/init.pp": "d398e7687ec1d893ef23d1b7d2afc094",
"hiera.yaml": "39d53b1fb13ec6eff1f3a5c0a1f02a9c",
"hiera.yaml": "992040941dac878c116c0e02a3ed757e",
"locales/config.yaml": "69304e9cce562aa59bd7bd4ddcb91b8b",
"locales/ja/puppetlabs-ntp.po": "7265ff57e178feb7a65835f7cf271e2c",
"locales/puppetlabs-ntp.pot": "7d6e724b81413279c5980f12c49c47d2",
"manifests/config.pp": "b6ed12bdaca9de825d94ad5d1b364c7e",
"manifests/init.pp": "5a920b2900bff6ac6112a7b437f15080",
"manifests/install.pp": "880a58dc03fdc0549735d8a48f6a9f30",
"manifests/service.pp": "ecbed8a4930ffe330b4dfa1d54f8e6fb",
"metadata.json": "8d432a00a4d68c2e55bb8f28309a5a8a",
"readmes/README_ja_JP.md": "644d8f7024da17afaba37d539a6cbb9a",
"spec/acceptance/class_spec.rb": "c3c170855ac51bde07b5d46303d302b7",
"spec/acceptance/disable_monitoring_spec.rb": "8b87b155fdf60bb8bf21dd8260d668a0",
"spec/acceptance/enable_mode7_spec.rb": "cf784656915ec0dbf81b42b151b94f7e",
"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": "ed4e8226551e461532a76547336b5832",
"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": "14f2045e4f9ceb6bf0a647db0d87fd38",
"spec/acceptance/ntp_service_spec.rb": "522d9e4d7a6728fb5761bef098b1b7b8",
"spec/acceptance/preferred_servers_spec.rb": "a245d379c90671b510c00905dd45e893",
"spec/acceptance/restrict_spec.rb": "81cf91ca9f0960c253f37ebca4c79242",
"spec/acceptance/statistics_spec.rb": "d49e1059ee1276f4b9fad80d69648625",
"spec/acceptance/unsupported_spec.rb": "1abe4a56a9fabd8d4a028aea8cffd04f",
"spec/classes/contains_spec.rb": "ce854eb7199c629c1e36510433316c87",
"spec/classes/ntp_spec.rb": "57cb3144d95d39cb07f556b353e4a05c",
"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": "ad4f5ef13505bef2ee629ac70abc2615",
"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": "f8d4ad67df4e29908dc23f74cc2e75ad",
"templates/ntp.conf.epp": "d892f9dfd38fa234505373df7e085a02",
"templates/step-tickers.epp": "1a20cfd4c636ce4f696b23419d6c9ace",
"types/key_id.pp": "e01c91e0839c5684495a8ea70f2399e5",
"types/poll_interval.pp": "6a2190db7dcfbf3a7be0f659b6fd287d"
......
......@@ -6,3 +6,4 @@ ntp::restrict:
- 'default nomodify notrap nopeer noquery'
- '127.0.0.1'
ntp::service_name: 'xntpd'
ntp::slewalways: 'no'
......@@ -45,6 +45,7 @@ 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: ~
......
......@@ -16,7 +16,7 @@ hierarchy:
path: '%{facts.os.name}.yaml'
- name: 'Operating System Family'
path: '%{facts.os.family}.yaml'
path: '%{facts.os.family}-family.yaml'
- name: 'common'
path: 'common.yaml'
......
# @api private
# This class handles the configuration file. Avoid modifying private classes.
class ntp::config inherits ntp {
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
......
This diff is collapsed.
# @api private
# @api private
# This class handles ntp packages. Avoid modifying private classes.
class ntp::install inherits ntp {
class ntp::install {
if $ntp::package_manage {
......
# @api private
# This class handles the ntp service. Avoid modifying private classes.
class ntp::service inherits ntp {
class ntp::service {
if $ntp::service_manage == true {
service { 'ntp':
......
{
"name": "puppetlabs-ntp",
"version": "7.0.0",
"version": "7.1.1",
"author": "Puppet Inc",
"summary": "Installs, configures, and manages the NTP service.",
"license": "Apache-2.0",
......@@ -108,5 +108,7 @@
"version_requirement": ">= 4.9.4 < 6.0.0"
}
],
"description": "NTP Module for Debian, Ubuntu, CentOS, RHEL, OEL, Fedora, FreeBSD, ArchLinux, Amazon Linux and Gentoo."
"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"
}
......@@ -19,28 +19,28 @@
### ntpモジュールの利用方法
`include '::ntp'` と記述するだけで利用可能です。参照するNTPサーバは、以下のようにパラメータで指定します。
`include ntp`と記述するだけで利用可能です。参照するNTPサーバは、以下のようにパラメータで指定します。
```puppet
class { '::ntp':
class { 'ntp':
servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ],
}
```
## 利用例
ntpモジュールのすべてのパラメータは、メインクラスである `::ntp` クラスに含まれているため、ntpモジュールで利用可能な全てのオプションを自由に設定できます。以下にユースケースを示します。
ntpモジュールのすべてのパラメータは、メインクラスである`ntp`クラスに含まれているため、ntpモジュールで利用可能な全てのオプションを自由に設定できます。以下にユースケースを示します。
### NTPをインストールして有効にする
```puppet
include '::ntp'
include ntp
```
### NTPサーバを変更する
```puppet
class { '::ntp':
class { 'ntp':
servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ],
}
```
......@@ -48,7 +48,7 @@ class { '::ntp':
### 接続可能ユーザ数を制限する
```puppet
class { '::ntp':
class { 'ntp':
servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ],
restrict => ['127.0.0.1'],
}
......@@ -57,7 +57,7 @@ class { '::ntp':
### 参照不可のNTPクライアントをインストールする
```puppet
class { '::ntp':
class { 'ntp':
servers => ['ntp1.corp.com', 'ntp2.corp.com'],
restrict => [
'default ignore',
......@@ -75,7 +75,7 @@ class { '::ntp':
Openstackノードには多数の仮想インターフェイスが存在する場合があるため、NTPサーバでLISTENするインターフェイスを特定のインターフェイスに制限するのは有効な手段です。
```puppet
class { '::ntp':
class { 'ntp':
servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ],
interfaces => ['127.0.0.1', '1.2.3.4']
}
......@@ -84,7 +84,7 @@ class { '::ntp':
### Puppetによるサービスの制御を中止する
```puppet
class { '::ntp':
class { 'ntp':
servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ],
restrict => ['127.0.0.1'],
service_manage => false,
......@@ -94,7 +94,7 @@ class { '::ntp':
### ntpパッケージはインストールせず、設定とサービス起動のみ実行する
```puppet
class { '::ntp':
class { 'ntp':
package_manage => false,
}
```
......@@ -102,7 +102,7 @@ class { '::ntp':
### カスタムテンプレートにパラメータを渡す
```puppet
class { '::ntp':
class { 'ntp':
servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ],
restrict => ['127.0.0.1'],
service_manage => false,
......@@ -126,7 +126,7 @@ class { '::ntp':
### パラメータ
`::ntp` クラスでは、以下のパラメータを使用できます。
`ntp`クラスでは、以下のパラメータを使用できます。
#### `authprov`
......@@ -385,7 +385,7 @@ NTPパッケージを管理するかどうか指定します。
データタイプ: 配列[文字列]
管理するNTPパッケージを指定します。
管理するNTPパッケージを指定します。
デフォルト値: ['ntp'] (AIX: 'bos.net.tcp.client'、Solaris: [ 'SUNWntp4r'、'SUNWntp4u' ])
......@@ -424,7 +424,7 @@ NTPパッケージを管理するかどうか指定します。
#### `noselect_servers`
配列[文字列]で、同期させない1つ以上のピアを指定します。Puppetによって`servers`配列内の一致する項目の最後に'noselect'が追加されます。デフォルト値: [ ]
配列[文字列]で、同期させない1つ以上のピアを指定します。Puppetによって`servers`配列内の一致する項目の最後に'noselect'が追加されます。デフォルト値: [ ]
#### `restrict`
......@@ -501,6 +501,16 @@ NTPに使用するサービスプロバイダ
デフォルト値: `undef`
#### `slewalways`
データタイプ: Enum['no'、'yes']
step動作を無効にし常にslewモードで徐々に時計を合わせるよう`xntpd`を設定するかどうかを指定します。
AIXといった`xntpd`を実行するプラットフォームにのみ適用し、その他のプラットフォームにこの設定を指定しないようにしてください。
デフォルト値: オペレーティングシステムによって異なります。
#### `statistics`
データタイプ: 配列
......
require 'spec_helper_acceptance'
describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
context 'ntp' do
context 'with ntp' do
let(:pp) { "class { 'ntp': }" }
it 'runs successfully - not_to match' do
......@@ -23,7 +23,7 @@ describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))
end
end
context 'service_ensure => stopped:' do
context 'when service_ensure => stopped:' do
let(:pp) { "class { 'ntp': service_ensure => stopped }" }
it 'runs successfully - not_to match' do
......@@ -33,7 +33,7 @@ describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))
end
end
context 'service_ensure => running:' do
context 'when service_ensure => running:' do
it 'runs successfully - not_to match' do
pp = "class { 'ntp': service_ensure => running }"
......
......@@ -7,7 +7,7 @@ config = if fact('osfamily') == 'Solaris'
end
describe 'ntp class with disable_monitor:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
context 'should disable' do
context 'with should disable' do
let(:pp) { "class { 'ntp': disable_monitor => true }" }
it 'runs twice' do
......@@ -20,7 +20,7 @@ describe 'ntp class with disable_monitor:', unless: UNSUPPORTED_PLATFORMS.includ
end
end
context 'should not disable' do
context 'when enabled' do
let(:pp) { "class { 'ntp': disable_monitor => false }" }
it 'runs twice' do
......
......@@ -7,7 +7,7 @@ config = if fact('osfamily') == 'Solaris'
end
describe 'ntp class with enable_mode7:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
context 'should enable' do
context 'with enable' do
let(:pp) { "class { 'ntp': enable_mode7 => true }" }
it 'runs twice' do
......@@ -20,7 +20,7 @@ describe 'ntp class with enable_mode7:', unless: UNSUPPORTED_PLATFORMS.include?(
end
end
context 'should not enable' do
context 'with disable' do
let(:pp) { "class { 'ntp': enable_mode7 => false }" }
it 'runs twice' do
......
......@@ -7,12 +7,12 @@ config = if fact('osfamily') == 'Solaris'
end
describe 'noselect servers', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
pp = <<-EOS
pp = <<-MANIFEST
class { '::ntp':
servers => ['a', 'b', 'c', 'd'],
noselect_servers => ['c', 'd'],
}
EOS
MANIFEST
it 'applies cleanly' do
apply_manifest(pp, catch_failures: true) do |r|
......
......@@ -131,7 +131,7 @@ describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))
end
describe 'keys' do
pp = <<-EOS
pp = <<-MANIFEST
class { 'ntp':
keys_enable => true,
keys_controlkey => 1,
......@@ -139,7 +139,7 @@ describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))
keys_trusted => [ 1, 2 ],
keys => [ '1 M AAAABBBB' ],
}
EOS
MANIFEST
it 'enables the key parameters' do
apply_manifest(pp, catch_failures: true)
......@@ -160,12 +160,12 @@ describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))
end
describe 'package' do
pp = <<-EOS
pp = <<-MANIFEST
class { 'ntp':
package_ensure => present,
package_name => #{Array(packagename).inspect},
}
EOS
MANIFEST
it 'installs the right package' do
apply_manifest(pp, catch_failures: true)
......@@ -179,11 +179,11 @@ describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))
end
describe 'panic => 0' do
pp = <<-EOS
pp = <<-MANIFEST
class { 'ntp':
panic => 0,
}
EOS
MANIFEST
it 'disables the tinker panic setting' do
apply_manifest(pp, catch_failures: true)
......@@ -195,11 +195,11 @@ describe 'ntp class:', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))
end
describe 'panic => 1' do
pp = <<-EOS