Skip to content

Commit 6b6e191

Browse files
author
Morgan Haskel
committed
Merge pull request #198 from mhaskel/test
Merge 3.1.x into master
2 parents d173b48 + 919aee6 commit 6b6e191

File tree

4 files changed

+64
-41
lines changed

4 files changed

+64
-41
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module Puppet::Parser::Functions
2+
newfunction(:ntp_dirname, :type => :rvalue, :doc => <<-EOS
3+
Returns the dirname of a path.
4+
EOS
5+
) do |arguments|
6+
7+
raise(Puppet::ParseError, "ntp_dirname(): Wrong number of arguments " +
8+
"given (#{arguments.size} for 1)") if arguments.size < 1
9+
10+
path = arguments[0]
11+
return File.dirname(path)
12+
end
13+
end
14+
15+
# vim: set ts=2 sw=2 et :

manifests/config.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
class ntp::config inherits ntp {
33

44
if $keys_enable {
5-
$directory = dirname($keys_file)
5+
$directory = ntp_dirname($keys_file)
66
file { $directory:
77
ensure => directory,
88
owner => 0,

manifests/params.pp

+45-37
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
case $::osfamily {
3232
'AIX': {
33-
$config = '/etc/ntp.conf'
34-
$keys_file = '/etc/ntp.keys'
33+
$config = $default_config
34+
$keys_file = '/etc/ntp.keys'
3535
$driftfile = '/etc/ntp.drift'
3636
$package_name = [ 'bos.net.tcp.client' ]
37-
$restrict = [
37+
$restrict = [
3838
'default nomodify notrap nopeer noquery',
3939
'127.0.0.1',
4040
]
@@ -48,7 +48,11 @@
4848
]
4949
}
5050
'Debian': {
51-
$restrict = [
51+
$config = $default_config
52+
$keys_file = $default_keys_file
53+
$driftfile = $default_driftfile
54+
$package_name = $default_package_name
55+
$restrict = [
5256
'default kod nomodify notrap nopeer noquery',
5357
'-6 default kod nomodify notrap nopeer noquery',
5458
'127.0.0.1',
@@ -64,13 +68,17 @@
6468
]
6569
}
6670
'RedHat': {
67-
$restrict = [
71+
$config = $default_config
72+
$keys_file = $default_keys_file
73+
$driftfile = $default_driftfile
74+
$package_name = $default_package_name
75+
$service_name = $default_service_name
76+
$restrict = [
6877
'default kod nomodify notrap nopeer noquery',
6978
'-6 default kod nomodify notrap nopeer noquery',
7079
'127.0.0.1',
7180
'-6 ::1',
7281
]
73-
$service_name = 'ntpd'
7482
$iburst_enable = false
7583
$servers = [
7684
'0.centos.pool.ntp.org',
@@ -79,8 +87,11 @@
7987
]
8088
}
8189
'SuSE': {
90+
$config = $default_config
91+
$keys_file = $default_keys_file
8292
$driftfile = '/var/lib/ntp/drift/ntp.drift'
83-
$restrict = [
93+
$package_name = $default_package_name
94+
$restrict = [
8495
'default kod nomodify notrap nopeer noquery',
8596
'-6 default kod nomodify notrap nopeer noquery',
8697
'127.0.0.1',
@@ -96,15 +107,17 @@
96107
]
97108
}
98109
'FreeBSD': {
110+
$config = $default_config
99111
$driftfile = '/var/db/ntpd.drift'
112+
$keys_file = $default_keys_file
100113
$package_name = ['net/ntp']
101-
$restrict = [
114+
$restrict = [
102115
'default kod nomodify notrap nopeer noquery',
103116
'-6 default kod nomodify notrap nopeer noquery',
104117
'127.0.0.1',
105118
'-6 ::1',
106119
]
107-
$service_name = 'ntpd'
120+
$service_name = $default_service_name
108121
$iburst_enable = true
109122
$servers = [
110123
'0.freebsd.pool.ntp.org maxpoll 9',
@@ -114,13 +127,17 @@
114127
]
115128
}
116129
'Archlinux': {
117-
$restrict = [
130+
$config = $default_config
131+
$keys_file = $default_keys_file
132+
$driftfile = $default_driftfile
133+
$package_name = $default_package_name
134+
$service_name = $default_service_name
135+
$restrict = [
118136
'default kod nomodify notrap nopeer noquery',
119137
'-6 default kod nomodify notrap nopeer noquery',
120138
'127.0.0.1',
121139
'-6 ::1',
122140
]
123-
$service_name = 'ntpd'
124141
$iburst_enable = false
125142
$servers = [
126143
'0.pool.ntp.org',
@@ -129,22 +146,22 @@
129146
]
130147
}
131148
'Solaris': {
132-
$config = '/etc/inet/ntp.conf'
133-
$driftfile = '/var/ntp/ntp.drift'
134-
$keys_file = '/etc/inet/ntp.keys'
135-
$package_name = $::operatingsystemrelease ? {
149+
$config = '/etc/inet/ntp.conf'
150+
$driftfile = '/var/ntp/ntp.drift'
151+
$keys_file = '/etc/inet/ntp.keys'
152+
$package_name = $::operatingsystemrelease ? {
136153
/^(5\.10|10|10_u\d+)$/ => [ 'SUNWntpr', 'SUNWntpu' ],
137154
/^(5\.11|11|11\.\d+)$/ => [ 'service/network/ntp' ]
138155
}
139-
$restrict = [
156+
$restrict = [
140157
'default kod nomodify notrap nopeer noquery',
141158
'-6 default kod nomodify notrap nopeer noquery',
142159
'127.0.0.1',
143160
'-6 ::1',
144161
]
145-
$service_name = 'network/ntp'
162+
$service_name = 'network/ntp'
146163
$iburst_enable = false
147-
$servers = [
164+
$servers = [
148165
'0.pool.ntp.org',
149166
'1.pool.ntp.org',
150167
'2.pool.ntp.org',
@@ -153,14 +170,17 @@
153170
}
154171
# Gentoo was added as its own $::osfamily in Facter 1.7.0
155172
'Gentoo': {
173+
$config = $default_config
174+
$keys_file = $default_keys_file
175+
$driftfile = $default_driftfile
156176
$package_name = ['net-misc/ntp']
157-
$restrict = [
177+
$service_name = $default_service_name
178+
$restrict = [
158179
'default kod nomodify notrap nopeer noquery',
159180
'-6 default kod nomodify notrap nopeer noquery',
160181
'127.0.0.1',
161182
'-6 ::1',
162183
]
163-
$service_name = 'ntpd'
164184
$iburst_enable = false
165185
$servers = [
166186
'0.gentoo.pool.ntp.org',
@@ -174,14 +194,17 @@
174194
# Before Facter 1.7.0 Gentoo did not have its own $::osfamily
175195
case $::operatingsystem {
176196
'Gentoo': {
197+
$config = $default_config
198+
$keys_file = $default_keys_file
199+
$driftfile = $default_driftfile
200+
$service_name = $default_service_name
177201
$package_name = ['net-misc/ntp']
178-
$restrict = [
202+
$restrict = [
179203
'default kod nomodify notrap nopeer noquery',
180204
'-6 default kod nomodify notrap nopeer noquery',
181205
'127.0.0.1',
182206
'-6 ::1',
183207
]
184-
$service_name = 'ntpd'
185208
$iburst_enable = false
186209
$servers = [
187210
'0.gentoo.pool.ntp.org',
@@ -199,19 +222,4 @@
199222
fail("The ${module_name} module is not supported on an ${::osfamily} based system.")
200223
}
201224
}
202-
if $config == undef {
203-
$config = $default_config
204-
}
205-
if $keys_file == undef {
206-
$keys_file = $default_keys_file
207-
}
208-
if $driftfile == undef {
209-
$driftfile = $default_driftfile
210-
}
211-
if $package_name == undef {
212-
$package_name = $default_package_name
213-
}
214-
if $service_name == undef {
215-
$service_name = $default_service_name
216-
}
217225
}

metadata.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "Apache Version 2.0",
77
"source": "git://github.com/puppetlabs/puppetlabs-ntp",
88
"project_page": "http://github.com/puppetlabs/puppetlabs-ntp",
9-
"issues_url": "https://github.com/puppetlabs/puppetlabs-ntp/issues",
9+
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
1010
"operatingsystem_support": [
1111
{
1212
"operatingsystem": "RedHat",
@@ -77,7 +77,7 @@
7777
"requirements": [
7878
{
7979
"name": "pe",
80-
"version_requirement": "3.3.x"
80+
"version_requirement": "3.x"
8181
},
8282
{
8383
"name": "puppet",
@@ -88,7 +88,7 @@
8888
"dependencies": [
8989
{
9090
"name": "puppetlabs/stdlib",
91-
"version_requirement": ">= 4.0.0"
91+
"version_requirement": ">= 3.2.0 < 5.0.0"
9292
}
9393
]
9494
}

0 commit comments

Comments
 (0)