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

Client include #29

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
$nfs_v4_idmap_domain = $nfs::params::nfs_v4_idmap_domain
) inherits nfs::params {

class{ "nfs::client::${osfamily}":
nfs_v4 => $nfs_v4,
nfs_v4_idmap_domain => $nfs_v4_idmap_domain,
}
include "::nfs::client::${osfamily}"

Class["::nfs::client::${osfamily}::install"] ->
Class["::nfs::client::${osfamily}::configure"] ->
Class["::nfs::client::${osfamily}"] ->
Class['::nfs::client']
}
2 changes: 1 addition & 1 deletion manifests/client/darwin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
$nfs_v4 = false,
$nfs_v4_idmap_domain = undef
) {

fail("NFS client is not supported on Darwin")
}
5 changes: 2 additions & 3 deletions manifests/client/debian.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
class nfs::client::debian (
$nfs_v4 = false,
$nfs_v4_idmap_domain = undef
$nfs_v4 = $::nfs::client::nfs_v4,
$nfs_v4_idmap_domain = $::nfs::client::nfs_v4_idmap_domain,
) {

include nfs::client::debian::install,
nfs::client::debian::configure,
nfs::client::debian::service

}
2 changes: 1 addition & 1 deletion manifests/client/mount.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
) {

include nfs::client

Class["nfs::client"] -> Nfs::Client::Mount["$title"]

if $nfs::client::nfs_v4 == true {

Expand Down
10 changes: 4 additions & 6 deletions manifests/client/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
# refactored a bit

class nfs::client::redhat (
$nfs_v4 = false,
$nfs_v4_idmap_domain = undef
$nfs_v4 = $::nfs::client::nfs_v4,
$nfs_v4_idmap_domain = $::nfs::client::nfs_v4_idmap_domain,
) inherits nfs::client::redhat::params {

include nfs::client::redhat::install,
nfs::client::redhat::configure,
include nfs::client::redhat::install,
nfs::client::redhat::configure,
nfs::client::redhat::service


}
26 changes: 13 additions & 13 deletions manifests/mkdir.pp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Nasty ass hax to allow several levels of directories
# Ensures the directory exists in the catalag
define nfs::mkdir() {
if ! defined (File[$name]) {
exec { "mkdir_recurse_${name}" :
path => [ '/bin', '/usr/bin' ],
command => "mkdir -p ${name}",
unless => "test -d ${name}",
}

exec { "mkdir_recurse_${name}":
path => [ '/bin', '/usr/bin' ],
command => "mkdir -p ${name}",
unless => "test -d ${name}",
}

file {
"${name}":
ensure => directory,
require => Exec["mkdir_recurse_${name}"]
}

}
file { $name :
ensure => directory,
require => Exec["mkdir_recurse_${name}"]
}
}
}
2 changes: 1 addition & 1 deletion manifests/server/export.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define nfs::server::export (
$v3_export_name = $name,
$v4_export_name = regsubst($name, '.*/(.*)', '\1' ),
$clients = 'localhost(ro)',
$clients = ['localhost(ro)'],
$bind = 'rbind',
# globals for this share
# propogated to storeconfigs
Expand Down
2 changes: 1 addition & 1 deletion manifests/server/export/configure.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
) {

if $ensure != 'absent' {
$line = "${name} ${clients}\n"
$line = sprintf("%s %s\n", $name, join($clients, " "))

concat::fragment{
"${name}":
Expand Down
11 changes: 10 additions & 1 deletion spec/defines/server_export_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@

describe 'nfs::server::export' do
let(:title) { '/srv/test' }
#let(:params) {{ :server => 'nfs.int.net', :share => '/srv/share' } }
let(:params) {{
#:server => 'nfs.int.net',
#:share => '/srv/share'
:clients => [
'localhost(ro)',
'$network}/$netmask(rw,async,all_squash,anonuid=99,anongid=99)',
'nfsclient(ro)',
]
}}
let(:facts){{:concat_basedir => '/var/lib/puppet/concat',}}
it do
should contain_nfs__server__export__configure('/srv/test')
end
Expand Down