Skip to content

Commit 3f9726c

Browse files
author
Morgan Haskel
committed
Merge pull request #210 from puppetlabs/3.2.x
Merge 3.2.x back into master
2 parents 6b6e191 + b8069ab commit 3f9726c

12 files changed

+98
-47
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
##2014-09-10 - Supported Release 3.2.0
2+
###Summary
3+
4+
This is primarily a feature release. It adds a few new parameters to class `ntp`
5+
and adds support for Solaris 11.
6+
7+
####Features
8+
- Add the `$interfaces` parameter to `ntp`
9+
- Add support for Solaris 10 and 11
10+
- Synchronized files with modulesync
11+
- Test updates
12+
- Add the `$iburst_enable` parameter to `ntp`
13+
14+
####Bugfixes
15+
- Fixes for strict variables
16+
- Remove dependency on stdlib4
17+
118
##2014-06-06 - Release 3.1.2
219
###Summary
320

README.markdown

+5-1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ Sets the location of the drift file for ntp.
143143

144144
Set the iburst option in the ntp configuration. If enabled the option is set for every ntp peer.
145145

146+
####`interfaces`
147+
148+
Sets the list of interfaces NTP will listen on. This parameter must be an array.
149+
146150
####`keys_controlkey`
147151

148152
The key to use as the control key.
@@ -225,7 +229,7 @@ The module has been tested on:
225229
* Gentoo
226230
* Arch Linux
227231
* FreeBSD
228-
* Solaris 10, 11
232+
* Solaris 11
229233
* AIX 5.3, 6.1, 7.1
230234

231235
Testing on other platforms has been light and cannot be guaranteed.

manifests/params.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
'2.centos.pool.ntp.org',
8787
]
8888
}
89-
'SuSE': {
89+
'Suse': {
9090
$config = $default_config
9191
$keys_file = $default_keys_file
9292
$driftfile = '/var/lib/ntp/drift/ntp.drift'

metadata.json

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "puppetlabs-ntp",
3-
"version": "3.1.2",
3+
"version": "3.2.0",
44
"author": "Puppet Labs",
55
"summary": "NTP Module",
66
"license": "Apache Version 2.0",
7-
"source": "git://github.com/puppetlabs/puppetlabs-ntp",
8-
"project_page": "http://github.com/puppetlabs/puppetlabs-ntp",
7+
"source": "https://github.com/puppetlabs/puppetlabs-ntp",
8+
"project_page": "https://github.com/puppetlabs/puppetlabs-ntp",
99
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
1010
"operatingsystem_support": [
1111
{
@@ -61,7 +61,6 @@
6161
{
6262
"operatingsystem": "Solaris",
6363
"operatingsystemrelease": [
64-
"10",
6564
"11"
6665
]
6766
},
@@ -86,9 +85,6 @@
8685
],
8786
"description": "NTP Module for Debian, Ubuntu, CentOS, RHEL, OEL, Fedora, FreeBSD, ArchLinux and Gentoo.",
8887
"dependencies": [
89-
{
90-
"name": "puppetlabs/stdlib",
91-
"version_requirement": ">= 3.2.0 < 5.0.0"
92-
}
88+
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"}
9389
]
9490
}

spec/acceptance/disable_monitoring_spec.rb

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
require 'spec_helper_acceptance'
22

3+
if (fact('osfamily') == 'Solaris')
4+
config = '/etc/inet/ntp.conf'
5+
else
6+
config = '/etc/ntp.conf'
7+
end
8+
39
describe "ntp class with disable_monitor:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
410
context 'should run successfully' do
511
pp = "class { 'ntp': disable_monitor => true }"
@@ -9,8 +15,8 @@
915
apply_manifest(pp, :catch_changes => true)
1016
end
1117

12-
describe file('/etc/ntp.conf') do
13-
it { should contain('disable monitor') }
18+
describe file("#{config}") do
19+
its(:content) { should match('disable monitor') }
1420
end
1521
end
1622

@@ -22,8 +28,8 @@
2228
apply_manifest(pp, :catch_changes => true)
2329
end
2430

25-
describe file('/etc/ntp.conf') do
26-
it { should_not contain('disable monitor') }
31+
describe file("#{config}") do
32+
its(:content) { should_not match('disable monitor') }
2733
end
2834
end
2935

spec/acceptance/ntp_config_spec.rb

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
line = '0.debian.pool.ntp.org iburst'
88
when 'RedHat'
99
line = '0.centos.pool.ntp.org'
10-
when 'SuSE'
10+
when 'Suse'
1111
line = '0.opensuse.pool.ntp.org'
1212
when 'Gentoo'
1313
line = '0.gentoo.pool.ntp.org'
@@ -24,15 +24,21 @@
2424
line = '0.debian.pool.ntp.org iburst'
2525
end
2626

27+
if (fact('osfamily') == 'Solaris')
28+
config = '/etc/inet/ntp.conf'
29+
else
30+
config = '/etc/ntp.conf'
31+
end
32+
2733
describe 'ntp::config class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
2834
it 'sets up ntp.conf' do
2935
apply_manifest(%{
3036
class { 'ntp': }
3137
}, :catch_failures => true)
3238
end
3339

34-
describe file('/etc/ntp.conf') do
40+
describe file("#{config}") do
3541
it { should be_file }
36-
it { should contain line }
42+
its(:content) { should match line }
3743
end
3844
end

spec/acceptance/ntp_parameters_spec.rb

+21-15
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
packagename = 'ntp'
2626
end
2727

28+
if (fact('osfamily') == 'Solaris')
29+
config = '/etc/inet/ntp.conf'
30+
else
31+
config = '/etc/ntp.conf'
32+
end
33+
2834
describe "ntp class:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
2935
it 'applies successfully' do
3036
pp = "class { 'ntp': }"
@@ -67,9 +73,9 @@
6773
apply_manifest(pp, :catch_failures => true)
6874
end
6975

70-
describe file('/etc/ntp.conf') do
76+
describe file("#{config}") do
7177
it { should be_file }
72-
it { should contain 'testcontent' }
78+
its(:content) { should match 'testcontent' }
7379
end
7480
end
7581

@@ -79,9 +85,9 @@
7985
apply_manifest(pp, :catch_failures => true)
8086
end
8187

82-
describe file('/etc/ntp.conf') do
88+
describe file("#{config}") do
8389
it { should be_file }
84-
it { should contain 'driftfile /tmp/driftfile' }
90+
its(:content) { should match 'driftfile /tmp/driftfile' }
8591
end
8692
end
8793

@@ -102,12 +108,12 @@ class { 'ntp':
102108
apply_manifest(pp, :catch_failures => true)
103109
end
104110

105-
describe file('/etc/ntp.conf') do
111+
describe file("#{config}") do
106112
it { should be_file }
107-
it { should contain 'keys /etc/ntp/keys' }
108-
it { should contain 'controlkey /etc/ntp/controlkey' }
109-
it { should contain 'requestkey 1' }
110-
it { should contain 'trustedkey 1 2' }
113+
its(:content) { should match 'keys /etc/ntp/keys' }
114+
its(:content) { should match 'controlkey /etc/ntp/controlkey' }
115+
its(:content) { should match 'requestkey 1' }
116+
its(:content) { should match 'trustedkey 1 2' }
111117
end
112118
end
113119

@@ -139,8 +145,8 @@ class { 'ntp':
139145
apply_manifest(pp, :catch_failures => true)
140146
end
141147

142-
describe file('/etc/ntp.conf') do
143-
it { should contain 'tinker panic' }
148+
describe file("#{config}") do
149+
its(:content) { should match 'tinker panic' }
144150
end
145151
end
146152

@@ -154,8 +160,8 @@ class { 'ntp':
154160
apply_manifest(pp, :catch_failures => true)
155161
end
156162

157-
describe file('/etc/ntp.conf') do
158-
it { should_not contain 'tinker panic 0' }
163+
describe file("#{config}") do
164+
its(:content) { should_not match 'tinker panic 0' }
159165
end
160166
end
161167

@@ -165,9 +171,9 @@ class { 'ntp':
165171
apply_manifest(pp, :catch_failures => true)
166172
end
167173

168-
describe file('/etc/ntp.conf') do
174+
describe file("#{config}") do
169175
it { should be_file }
170-
it { should contain '127.127.1.0' }
176+
its(:content) { should match '127.127.1.0' }
171177
end
172178
end
173179

spec/acceptance/preferred_servers_spec.rb

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
require 'spec_helper_acceptance'
22

3+
if (fact('osfamily') == 'Solaris')
4+
config = '/etc/inet/ntp.conf'
5+
else
6+
config = '/etc/ntp.conf'
7+
end
8+
39
describe 'preferred servers', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
410
pp = <<-EOS
511
class { '::ntp':
@@ -14,10 +20,10 @@ class { '::ntp':
1420
end
1521
end
1622

17-
describe file('/etc/ntp.conf') do
23+
describe file("#{config}") do
1824
it { should be_file }
19-
it { should contain 'server a' }
20-
it { should contain 'server b' }
25+
its(:content) { should match 'server a' }
26+
its(:content) { should match 'server b' }
2127
its(:content) { should match /server c (iburst\s|)prefer/ }
2228
its(:content) { should match /server d (iburst\s|)prefer/ }
2329
end

spec/acceptance/restrict_spec.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
require 'spec_helper_acceptance'
22

3+
if (fact('osfamily') == 'Solaris')
4+
config = '/etc/inet/ntp.conf'
5+
else
6+
config = '/etc/ntp.conf'
7+
end
8+
39
describe "ntp class with restrict:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
410
context 'should run successfully' do
511
it 'runs twice' do
@@ -12,8 +18,8 @@
1218
end
1319
end
1420

15-
describe file('/etc/ntp.conf') do
16-
it { should contain('test restrict') }
21+
describe file("#{config}") do
22+
its(:content) { should match('test restrict') }
1723
end
1824

1925
end

spec/classes/ntp_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
describe 'ntp' do
44
let(:facts) {{ :is_virtual => 'false' }}
55

6-
['Debian', 'RedHat','SuSE', 'FreeBSD', 'Archlinux', 'Gentoo', 'Gentoo (Facter < 1.7)'].each do |system|
6+
['Debian', 'RedHat','Suse', 'FreeBSD', 'Archlinux', 'Gentoo', 'Gentoo (Facter < 1.7)'].each do |system|
77
context "when on system #{system}" do
88
if system == 'Gentoo (Facter < 1.7)'
99
let :facts do
@@ -287,9 +287,9 @@
287287
end
288288
end
289289

290-
describe "on osfamily SuSE" do
290+
describe "on osfamily Suse" do
291291
let :facts do
292-
super().merge({ :osfamily => 'SuSE' })
292+
super().merge({ :osfamily => 'Suse' })
293293
end
294294

295295
it 'uses the opensuse ntp servers by default' do

spec/spec_helper_acceptance.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
on host, "/bin/echo '' > #{host['hieraconf']}"
1515
end
1616
on host, "mkdir -p #{host['distmoduledir']}"
17-
on host, 'puppet module install puppetlabs-stdlib', :acceptable_exit_codes => [0,1]
17+
on host, puppet('module install puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
1818
end
1919
end
2020

@@ -27,7 +27,11 @@
2727

2828
# Configure all nodes in nodeset
2929
c.before :suite do
30-
# Install module
31-
puppet_module_install(:source => proj_root, :module_name => 'ntp')
30+
hosts.each do |host|
31+
on host, "mkdir -p #{host['distmoduledir']}/ntp"
32+
%w(lib manifests templates metadata.json).each do |file|
33+
scp_to host, "#{proj_root}/#{file}", "#{host['distmoduledir']}/ntp"
34+
end
35+
end
3236
end
3337
end

templates/ntp.conf.erb

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ disable monitor
1515
# permit the source to query or modify the service on this system.
1616
<% @restrict.flatten.each do |restrict| -%>
1717
restrict <%= restrict %>
18-
<% end %>
18+
<% end -%>
1919
<% end -%>
2020

2121
<% if @interfaces != [] -%>
@@ -24,7 +24,7 @@ restrict <%= restrict %>
2424
interface ignore wildcard
2525
<% @interfaces.flatten.each do |interface| -%>
2626
interface listen <%= interface %>
27-
<% end %>
27+
<% end -%>
2828
<% end -%>
2929

3030
<% [@servers].flatten.each do |server| -%>
@@ -42,10 +42,10 @@ restrict 127.127.1.0
4242
# Driftfile.
4343
driftfile <%= @driftfile %>
4444

45-
<% unless @logfile.nil? %>
45+
<% unless @logfile.nil? -%>
4646
# Logfile
4747
logfile = <%= @logfile %>
48-
<% end %>
48+
<% end -%>
4949

5050
<% if @keys_enable -%>
5151
keys <%= @keys_file %>

0 commit comments

Comments
 (0)