Skip to content

Commit

Permalink
Merge pull request #177 from ody/solaris_11_support
Browse files Browse the repository at this point in the history
Add Solaris 11 support.
  • Loading branch information
Morgan Haskel committed Jul 25, 2014
2 parents 25ab29d + b93340b commit 1d65ae1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ The module has been tested on:
* Gentoo
* Arch Linux
* FreeBSD
* Solaris 10
* Solaris 10, 11
* AIX 5.3, 6.1, 7.1

Testing on other platforms has been light and cannot be guaranteed.
Expand Down
5 changes: 4 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@
$config = '/etc/inet/ntp.conf'
$driftfile = '/var/ntp/ntp.drift'
$keys_file = '/etc/inet/ntp.keys'
$package_name = [ 'SUNWntpr', 'SUNWntpu' ]
$package_name = $::operatingsystemrelease ? {
'5.10' => [ 'SUNWntpr', 'SUNWntpu' ],
'5.11' => [ 'service/network/ntp' ]
}
$restrict = [
'default kod nomodify notrap nopeer noquery',
'-6 default kod nomodify notrap nopeer noquery',
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"10"
"10",
"11"
]
},
{
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 @@ -15,9 +15,13 @@
when 'AIX'
packagename = 'bos.net.tcp.client'
when 'Solaris'
packagename = ['SUNWntpr','SUNWntpu']
case fact('operatingsystemrelease')
when '5.10'
packagename = ['SUNWntpr','SUNWntpu']
when '5.11'
packagename = 'service/network/ntp'
end
else
packagename = 'ntp'
end

describe 'ntp::install class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
Expand Down
7 changes: 6 additions & 1 deletion spec/acceptance/ntp_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
when 'AIX'
packagename = 'bos.net.tcp.client'
when 'Solaris'
packagename = ['SUNWntpr','SUNWntpu']
case fact('operatingsystemrelease')
when '5.10'
packagename = ['SUNWntpr','SUNWntpu']
when '5.11'
packagename = 'service/network/ntp'
end
else
packagename = 'ntp'
end
Expand Down
14 changes: 12 additions & 2 deletions spec/classes/ntp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,18 @@
end
end

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

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 "on osfamily Solaris and operatingsystemrelease 5.11" do
let(:facts) {{ :osfamily => 'Solaris', :operatingsystemrelease => '5.11' }}

it 'uses the NTP pool servers by default' do
should contain_file('/etc/inet/ntp.conf').with({
Expand Down

0 comments on commit 1d65ae1

Please sign in to comment.