Skip to content

Commit

Permalink
Merge pull request arioch#2 from traylenator/rhel7
Browse files Browse the repository at this point in the history
Redhat 7 Client Support
  • Loading branch information
dwerder committed Dec 12, 2014
2 parents 95a8987 + a30625f commit d048f87
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 9 deletions.
2 changes: 1 addition & 1 deletion manifests/client/redhat/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ensure => present,
}

if $nfs::client::redhat::osmajor == 6 {
if $nfs::client::redhat::osmajor == 6 or $nfs::client::redhat::osmajor == 7 {
package {'rpcbind':
ensure => present,
}
Expand Down
4 changes: 3 additions & 1 deletion manifests/client/redhat/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

class nfs::client::redhat::params {

if versioncmp($::operatingsystemrelease, "6.0") > 0 {
if versioncmp($::operatingsystemrelease, "7.0") > 0 {
$osmajor = 7
} elsif versioncmp($::operatingsystemrelease, "6.0") > 0 {
$osmajor = 6
} elsif versioncmp($::operatingsystemrelease, "5.0") > 0 {
$osmajor = 5
Expand Down
22 changes: 15 additions & 7 deletions manifests/client/redhat/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,32 @@
}

service {"nfslock":
name => $nfs::client::redhat::osmajor ? {
7 => "nfs-lock",
6 => "nfslock",
5 => "nfslock"
},
ensure => running,
enable => true,
hasstatus => true,
require => $nfs::client::redhat::osmajor ? {
7 => Service["rpcbind"],
6 => Service["rpcbind"],
5 => [Package["portmap"], Package["nfs-utils"]]
},
}

service { "netfs":
enable => true,
require => $nfs::client::redhat::osmajor ? {
6 => Service["nfslock"],
5 => [Service["portmap"], Service["nfslock"]],
},
if $nfs::client::redhat::osmajor == 5 or $nfs::client::redhat::osmajor == 6 {
service { "netfs":
enable => true,
require => $nfs::client::redhat::osmajor ? {
6 => Service["nfslock"],
5 => [Service["portmap"], Service["nfslock"]],
},
}
}

if $nfs::client::redhat::osmajor == 6 {
if $nfs::client::redhat::osmajor == 6 or $nfs::client::redhat::osmajor == 7 {
service {"rpcbind":
ensure => running,
enable => true,
Expand Down
15 changes: 15 additions & 0 deletions spec/classes/client_redhat_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
require 'spec_helper'
describe 'nfs::client::redhat' do
let(:facts) { {:osmajor => 7 } }
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_package('nfs-utils')
should contain_class('nfs::client::redhat')
should contain_package('rpcbind')
should contain_service('rpcbind').with(
'ensure' => 'running'
)
end
let(:facts) { {:osmajor => 6 } }
it do
should contain_class('nfs::client::redhat::install')
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@
let(:facts) { {:operatingsystem => 'scientific', :osmajor => 6 } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => centos v7" do
let(:facts) { {:operatingsystem => 'centos', :osmajor => 7 } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => centos v6" do
let(:facts) { {:operatingsystem => 'centos', :osmajor => 6 } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => redhat v7" do
let(:facts) { {:operatingsystem => 'redhat', :osmajor => 7 } }
it { should contain_class('nfs::client::redhat') }
end
context "operatingsysten => redhat v6" do
let(:facts) { {:operatingsystem => 'redhat', :osmajor => 6 } }
it { should contain_class('nfs::client::redhat') }
Expand Down

0 comments on commit d048f87

Please sign in to comment.