Skip to content

(MODULES-213) Solaris 10 support #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ The module has been tested on:
* Gentoo
* Arch Linux
* FreeBSD
* Solaris 10
* AIX 5.3, 6.1, 7.1

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

Expand Down
3 changes: 1 addition & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#
class ntp::install inherits ntp {

package { 'ntp':
package { $package_name:
ensure => $package_ensure,
name => $package_name,
}

}
19 changes: 19 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,25 @@
'2.pool.ntp.org',
]
}
'Solaris': {
$config = '/etc/inet/ntp.conf'
$driftfile = '/var/ntp/ntp.drift'
$keys_file = '/etc/inet/ntp.keys'
$package_name = [ 'SUNWntpr', 'SUNWntpu' ]
$restrict = [
'default kod nomodify notrap nopeer noquery',
'-6 default kod nomodify notrap nopeer noquery',
'127.0.0.1',
'-6 ::1',
]
$service_name = 'network/ntp'
$servers = [
'0.pool.ntp.org',
'1.pool.ntp.org',
'2.pool.ntp.org',
'3.pool.ntp.org',
]
}
# Gentoo was added as its own $::osfamily in Facter 1.7.0
'Gentoo': {
$config = '/etc/ntp.conf'
Expand Down
6 changes: 6 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
"14.04"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"10"
]
},
{
"operatingsystem": "AIX",
"operatingsystemrelease": [
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/ntp_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
when 'Gentoo'
line = '0.gentoo.pool.ntp.org'
end
when 'Solaris'
line = '0.pool.ntp.org'
when 'AIX'
line = '0.debian.pool.ntp.org iburst'
end
Expand Down
8 changes: 6 additions & 2 deletions spec/acceptance/ntp_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
end
when 'AIX'
packagename = 'bos.net.tcp.client'
when 'Solaris'
packagename = ['SUNWntpr','SUNWntpu']
else
packagename = 'ntp'
end
Expand All @@ -25,7 +27,9 @@ class { 'ntp': }
}, :catch_failures => true)
end

describe package(packagename) do
it { should be_installed }
Array(packagename).each do |package|
describe package(package) do
it { should be_installed }
end
end
end
10 changes: 7 additions & 3 deletions spec/acceptance/ntp_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
end
when 'AIX'
packagename = 'bos.net.tcp.client'
when 'Solaris'
packagename = ['SUNWntpr','SUNWntpu']
else
packagename = 'ntp'
end
Expand Down Expand Up @@ -109,14 +111,16 @@ class { 'ntp':
pp = <<-EOS
class { 'ntp':
package_ensure => present,
package_name => ['#{packagename}'],
package_name => #{Array(packagename).inspect},
}
EOS
apply_manifest(pp, :catch_failures => true)
end

describe package(packagename) do
it { should be_installed }
Array(packagename).each do |package|
describe package(package) do
it { should be_installed }
end
end
end

Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/ntp_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
case fact('osfamily')
when 'RedHat', 'FreeBSD', 'Linux', 'Gentoo'
servicename = 'ntpd'
when 'Solaris'
servicename = 'network/ntp'
when 'AIX'
servicename = 'xntpd'
else
Expand Down
15 changes: 12 additions & 3 deletions spec/classes/ntp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@
let(:params) {{ :package_ensure => 'present', :package_name => ['ntp'], }}

it { should contain_package('ntp').with(
:ensure => 'present',
:name => 'ntp'
:ensure => 'present'
)}

describe 'should allow package ensure to be overridden' do
Expand All @@ -111,7 +110,7 @@

describe 'should allow the package name to be overridden' do
let(:params) {{ :package_ensure => 'present', :package_name => ['hambaby'] }}
it { should contain_package('ntp').with_name('hambaby') }
it { should contain_package('hambaby') }
end
end

Expand Down Expand Up @@ -229,6 +228,16 @@
end
end

describe "on osfamily Solaris" do
let(:facts) {{ :osfamily => 'Solaris' }}

it 'uses the NTP pool servers by default' do
should contain_file('/etc/inet/ntp.conf').with({
'content' => /server \d.pool.ntp.org/,
})
end
end

describe "for operating system family unsupported" do
let(:facts) {{
:osfamily => 'unsupported',
Expand Down