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

Commit

Permalink
Fixing naming of nfs exports when leaving $mount param as default
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb Dangerfield committed Mar 27, 2015
1 parent 752a5bd commit a0d9461
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion manifests/server/export.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@
clients => $clients,
}
if $mount == undef {
$_mount = $v3_export_name
} else {
$_mount = $mount
}
@@nfs::client::mount {"shared ${v3_export_name} by ${::clientcert}":
ensure => $ensure,
mount => $mount,
mount => $_mount,
remounts => $remounts,
atboot => $atboot,
options => $options,
Expand Down
9 changes: 6 additions & 3 deletions spec/defines/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@
describe 'nfs::client::mount', :type => :define do
context "Mount created by exported resource" do
let(:title) { 'shared /srv/test by nfs.int.net' }
let(:facts) { { :operatingsystem => 'ubuntu' } }
let(:facts) { { :operatingsystem => 'ubuntu', :clientcert => 'test.example.com' } }
let(:params) {{
:server => 'nfs.int.net',
:share => '/srv/share',
:mount => Undef.new
:mount => '/srv/share'
}}
it do
should compile
should contain_class('nfs::client')
should contain_mount('shared nfs.int.net:/srv/share by test.example.com /srv/share')
end
end

context "Mount manually set" do
let(:title) { '/srv/test' }
let(:facts) { { :operatingsystem => 'ubuntu' } }
let(:facts) { { :operatingsystem => 'ubuntu', :clientcert => 'test.example.com' } }
let(:params) {{ :server => 'nfs.int.net', :share => '/srv/share' } }
it do
should compile
should contain_class('nfs::client')
should contain_mount('shared nfs.int.net:/srv/share by test.example.com /srv/test')
#should contain_mount('/srv/test')
end
end
end

0 comments on commit a0d9461

Please sign in to comment.