Skip to content

Commit 8e763ef

Browse files
committed
Merge pull request redhat-openstack#272 from jhoblitt/feature/fedora-support
fedora support
2 parents 9067bb6 + 7291d1a commit 8e763ef

6 files changed

Lines changed: 79 additions & 25 deletions

File tree

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Specifies the stratum the server should operate at when using the undisciplined
291291

292292
##Limitations
293293

294-
This module has been tested on [all PE-supported platforms](https://forge.puppetlabs.com/supported#compat-matrix), and no issues have been identified. Additionally, it is tested (but not supported) on Solaris 10 and 12.
294+
This module has been tested on [all PE-supported platforms](https://forge.puppetlabs.com/supported#compat-matrix), and no issues have been identified. Additionally, it is tested (but not supported) on Solaris 10 and 12 and Fedora 20-22.
295295

296296
##Development
297297

manifests/params.pp

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
$autoupdate = false
44
$config_template = 'ntp/ntp.conf.erb'
5-
$disable_monitor = false
65
$keys_enable = false
76
$keys_controlkey = ''
87
$keys_requestkey = ''
@@ -48,23 +47,24 @@
4847

4948
case $::osfamily {
5049
'AIX': {
51-
$config = $default_config
52-
$keys_file = '/etc/ntp.keys'
53-
$driftfile = '/etc/ntp.drift'
54-
$package_name = [ 'bos.net.tcp.client' ]
55-
$restrict = [
50+
$config = $default_config
51+
$keys_file = '/etc/ntp.keys'
52+
$driftfile = '/etc/ntp.drift'
53+
$package_name = [ 'bos.net.tcp.client' ]
54+
$restrict = [
5655
'default nomodify notrap nopeer noquery',
5756
'127.0.0.1',
5857
]
59-
$service_name = 'xntpd'
60-
$iburst_enable = true
61-
$servers = [
58+
$service_name = 'xntpd'
59+
$iburst_enable = true
60+
$servers = [
6261
'0.debian.pool.ntp.org',
6362
'1.debian.pool.ntp.org',
6463
'2.debian.pool.ntp.org',
6564
'3.debian.pool.ntp.org',
6665
]
67-
$maxpoll = undef
66+
$maxpoll = undef
67+
$disable_monitor = false
6868
}
6969
'Debian': {
7070
$config = $default_config
@@ -86,26 +86,48 @@
8686
'3.debian.pool.ntp.org',
8787
]
8888
$maxpoll = undef
89+
$disable_monitor = false
8990
}
9091
'RedHat': {
9192
$config = $default_config
9293
$keys_file = $default_keys_file
9394
$driftfile = $default_driftfile
9495
$package_name = $default_package_name
9596
$service_name = $default_service_name
96-
$restrict = [
97-
'default kod nomodify notrap nopeer noquery',
98-
'-6 default kod nomodify notrap nopeer noquery',
99-
'127.0.0.1',
100-
'-6 ::1',
101-
]
102-
$iburst_enable = false
103-
$servers = [
104-
'0.centos.pool.ntp.org',
105-
'1.centos.pool.ntp.org',
106-
'2.centos.pool.ntp.org',
107-
]
10897
$maxpoll = undef
98+
99+
case $::operatingsystem {
100+
'Fedora': {
101+
$restrict = [
102+
'default nomodify notrap nopeer noquery',
103+
'127.0.0.1',
104+
'::1',
105+
]
106+
$iburst_enable = true
107+
$servers = [
108+
'0.fedora.pool.ntp.org',
109+
'1.fedora.pool.ntp.org',
110+
'2.fedora.pool.ntp.org',
111+
'3.fedora.pool.ntp.org',
112+
]
113+
$disable_monitor = true
114+
}
115+
default: {
116+
$restrict = [
117+
'default kod nomodify notrap nopeer noquery',
118+
'-6 default kod nomodify notrap nopeer noquery',
119+
'127.0.0.1',
120+
'-6 ::1',
121+
]
122+
$iburst_enable = false
123+
$servers = [
124+
'0.centos.pool.ntp.org',
125+
'1.centos.pool.ntp.org',
126+
'2.centos.pool.ntp.org',
127+
]
128+
$disable_monitor = false
129+
}
130+
}
109131
}
110132
'Suse': {
111133
if $::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '12'
@@ -133,6 +155,7 @@
133155
'3.opensuse.pool.ntp.org',
134156
]
135157
$maxpoll = undef
158+
$disable_monitor = false
136159
}
137160
'FreeBSD': {
138161
$config = $default_config
@@ -154,6 +177,7 @@
154177
'3.freebsd.pool.ntp.org',
155178
]
156179
$maxpoll = 9
180+
$disable_monitor = false
157181
}
158182
'Archlinux': {
159183
$config = $default_config
@@ -175,6 +199,7 @@
175199
'3.arch.pool.ntp.org',
176200
]
177201
$maxpoll = undef
202+
$disable_monitor = false
178203
}
179204
'Solaris': {
180205
$config = '/etc/inet/ntp.conf'
@@ -207,6 +232,7 @@
207232
'3.pool.ntp.org',
208233
]
209234
$maxpoll = undef
235+
$disable_monitor = false
210236
}
211237
# Gentoo was added as its own $::osfamily in Facter 1.7.0
212238
'Gentoo': {
@@ -229,6 +255,7 @@
229255
'3.gentoo.pool.ntp.org',
230256
]
231257
$maxpoll = undef
258+
$disable_monitor = false
232259
}
233260
'Linux': {
234261
# Account for distributions that don't have $::osfamily specific settings.
@@ -254,6 +281,7 @@
254281
'3.gentoo.pool.ntp.org',
255282
]
256283
$maxpoll = undef
284+
$disable_monitor = false
257285
}
258286
default: {
259287
fail("The ${module_name} module is not supported on an ${::operatingsystem} distribution.")

metadata.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
"7"
4141
]
4242
},
43+
{
44+
"operatingsystem": "Fedora",
45+
"operatingsystemrelease": [
46+
"20",
47+
"21",
48+
"22"
49+
]
50+
},
4351
{
4452
"operatingsystem": "SLES",
4553
"operatingsystemrelease": [
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
HOSTS:
2+
fedora-21:
3+
roles:
4+
- master
5+
platform: fedora-21-x86_64
6+
box: chef/fedora-21
7+
hypervisor: vagrant
8+
CONFIG:
9+
type: foss

spec/acceptance/ntp_config_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
when 'Debian'
77
line = '0.debian.pool.ntp.org iburst'
88
when 'RedHat'
9-
line = '0.centos.pool.ntp.org'
9+
case fact('operatingsystem')
10+
when 'Fedora'
11+
line = '0.fedora.pool.ntp.org'
12+
else
13+
line = '0.centos.pool.ntp.org'
14+
end
1015
when 'Suse'
1116
line = '0.opensuse.pool.ntp.org'
1217
when 'Gentoo'

spec/classes/ntp_spec.rb

Lines changed: 5 additions & 1 deletion
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', 'Fedora', '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
@@ -13,6 +13,10 @@
1313
let :facts do
1414
super().merge({ :osfamily => system,:operatingsystem => 'SLES',:operatingsystemmajrelease => '11' })
1515
end
16+
elsif system == 'Fedora'
17+
let :facts do
18+
super().merge({ :osfamily => 'RedHat', :operatingsystem => system ,:operatingsystemmajrelease => '22' })
19+
end
1620
else
1721
let :facts do
1822
super().merge({ :osfamily => system })

0 commit comments

Comments
 (0)