Skip to content
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

Add Solaris 11 support. #177

Merged
merged 1 commit into from
Jul 25, 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: 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']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing the default assumption that the package is called ntp?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point...

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