Initial version of nfs client and server classes.
This commit is contained in:
parent
f8ca78d7fd
commit
56bf41ab9c
3 changed files with 113 additions and 0 deletions
0
nfs/files/exports
Normal file
0
nfs/files/exports
Normal file
62
nfs/files/nfs.sysconfig
Normal file
62
nfs/files/nfs.sysconfig
Normal file
|
@ -0,0 +1,62 @@
|
|||
#
|
||||
# Define which protocol versions mountd
|
||||
# will advertise. The values are "no" or "yes"
|
||||
# with yes being the default
|
||||
#MOUNTD_NFS_V1="no"
|
||||
#MOUNTD_NFS_V2="no"
|
||||
#MOUNTD_NFS_V3="no"
|
||||
#
|
||||
#
|
||||
# Path to remote quota server. See rquotad(8)
|
||||
#RQUOTAD="/usr/sbin/rpc.rquotad"
|
||||
# Port rquotad should listen on.
|
||||
RQUOTAD_PORT=4003
|
||||
# Optinal options passed to rquotad
|
||||
#RPCRQUOTADOPTS=""
|
||||
#
|
||||
#
|
||||
# TCP port rpc.lockd should listen on.
|
||||
LOCKD_TCPPORT=4001
|
||||
# UDP port rpc.lockd should listen on.
|
||||
LOCKD_UDPPORT=4001
|
||||
#
|
||||
#
|
||||
# Optional arguments passed to rpc.nfsd. See rpc.nfsd(8)
|
||||
RPCNFSDARGS="-N 4"
|
||||
# Number of nfs server processes to be started.
|
||||
# The default is 8.
|
||||
RPCNFSDCOUNT=64
|
||||
#
|
||||
#
|
||||
# Optional arguments passed to rpc.mountd. See rpc.mountd(8)
|
||||
RPCMOUNTDOPTS="--no-nfs-version 4"
|
||||
# Port rpc.mountd should listen on.
|
||||
MOUNTD_PORT=4002
|
||||
#
|
||||
#
|
||||
# Optional arguments passed to rpc.statd. See rpc.statd(8)
|
||||
#STATDARG=""
|
||||
# Port rpc.statd should listen on.
|
||||
STATD_PORT=4000
|
||||
# Outgoing port statd should used. The default is port
|
||||
# is random
|
||||
#STATD_OUTGOING_PORT=2020
|
||||
# Specify callout program
|
||||
#STATD_HA_CALLOUT="/usr/local/bin/foo"
|
||||
#
|
||||
#
|
||||
# Optional arguments passed to rpc.idmapd. See rpc.idmapd(8)
|
||||
#RPCIDMAPDARGS=""
|
||||
#
|
||||
# Set to turn on Secure NFS mounts.
|
||||
#SECURE_NFS="yes"
|
||||
# Optional arguments passed to rpc.gssd. See rpc.gssd(8)
|
||||
#RPCGSSDARGS="-vvv"
|
||||
# Optional arguments passed to rpc.svcgssd. See rpc.svcgssd(8)
|
||||
#RPCSVCGSSDARGS="-vvv"
|
||||
# Don't load security modules in to the kernel
|
||||
#SECURE_NFS_MODS="noload"
|
||||
#
|
||||
# Don't load sunrpc module.
|
||||
#RPCMTAB="noload"
|
||||
#
|
51
nfs/manifests/init.pp
Normal file
51
nfs/manifests/init.pp
Normal file
|
@ -0,0 +1,51 @@
|
|||
|
||||
class nfs::client {
|
||||
|
||||
package { "nfs-utils":
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
service { "nfslock":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package["nfs-utils"],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class nfs::server inherits nfs::client {
|
||||
|
||||
file { "/etc/exports":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/nfs/exports.${fqdn}",
|
||||
"puppet:///nfs/exports", ],
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => root,
|
||||
require => Package["nfs-utils"],
|
||||
notify => Exec["exportfs"],
|
||||
}
|
||||
|
||||
file { "/etc/sysconfig/nfs":
|
||||
ensure => present,
|
||||
source => "puppet:///nfs/nfs.sysconfig",
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => root,
|
||||
notify => Service["nfs"],
|
||||
}
|
||||
|
||||
service { "nfs":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package["nfs-utils"],
|
||||
}
|
||||
|
||||
exec { "exportfs":
|
||||
command => "exportfs -av",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
refreshonly => true,
|
||||
require => Service["nfs"],
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue