Skip to content

Commit 919aee6

Browse files
author
Morgan Haskel
committed
Fix for puppet 3
This was failing on puppet3.
1 parent 1edc1f0 commit 919aee6

File tree

1 file changed

+45
-37
lines changed

1 file changed

+45
-37
lines changed

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
}

0 commit comments

Comments
 (0)