Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Amazon linux support #17

Merged
merged 2 commits into from
Apr 17, 2015
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
4 changes: 4 additions & 0 deletions manifests/client/redhat/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
/^\d{2,}/: {
$osmajor = 7
}
# Amazon linux operatingsystemrelease is verbose: 3.10.35-43.137.amzn1.x86_64
/^3\.(\d|-|\.)+(amzn){1}/: {
$osmajor = 6
}
default:{
fail("Operatingsystemrelease ${::operatingsystemrelease} not supported")
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Somehow the ::osfamliy fact doesnt exist on some oled systems

case $::operatingsystem {
'centos', 'redhat', 'scientific', 'fedora', 'SLC', 'OracleLinux' : { $osfamily = 'redhat' }
'centos', 'redhat', 'scientific', 'fedora', 'SLC', 'OracleLinux', 'Amazon' : { $osfamily = 'redhat' }
'debian', 'Ubuntu' : { $osfamily = 'debian' }
'windows' : { fail('fail!11') }
'darwin' : { $osfamily = 'darwin' }
Expand Down
24 changes: 23 additions & 1 deletion spec/classes/client_redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,33 @@
end
end

context "operatingsystemrelease => 3.10.35-43.137.amzn1.x86_64" do
let(:facts) { {:operatingsystemrelease => "3.10.35-43.137.amzn1.x86_64" } }
it do
should contain_class('nfs::client::redhat::install')
should contain_class('nfs::client::redhat::configure')
should contain_class('nfs::client::redhat::service')

should contain_service('nfslock').with(
'ensure' => 'running'
)
should contain_service('netfs').with(
'enable' => 'true'
)
should contain_package('nfs-utils')
should contain_class('nfs::client::redhat')
should contain_package('rpcbind')
should contain_service('rpcbind').with(
'ensure' => 'running'
)
end
end

context ":nfs_v4 => true" do
let(:params) {{ :nfs_v4 => true }}
let(:facts) {{ :operatingsystemrelease => 6.4 }}
it do
should contain_augeas('/etc/idmapd.conf')
should contain_augeas('/etc/idmapd.conf')
end
end

Expand Down
4 changes: 4 additions & 0 deletions spec/classes/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
let(:facts) { {:operatingsystem => 'redhat', :operatingsystemrelease => 6.4 } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => Amazon v3" do
let(:facts) { {:operatingsystem => 'Amazon', :operatingsystemrelease => '3.10.35-43.137.amzn1.x86_64' } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => gentoo" do
let(:facts) { {:operatingsystem => 'gentoo', } }
it { should contain_class('nfs::client::gentoo') }
Expand Down
4 changes: 4 additions & 0 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
let(:facts) { {:operatingsystem => 'redhat', :concat_basedir => '/tmp', :operatingsystemrelease => 6.4 } }
it { should contain_class('nfs::server::redhat') }
end
context "operatingsysten => Amazon v3" do
let(:facts) { {:operatingsystem => 'Amazon', :concat_basedir => '/tmp', :operatingsystemrelease => '3.10.35-43.137.amzn1.x86_64' } }
it { should contain_class('nfs::server::redhat') }
end
context "operatingsysten => gentoo" do
let(:facts) { {:operatingsystem => 'gentoo', :concat_basedir => '/tmp',} }
it { should contain_class('nfs::server::gentoo') }
Expand Down