diff --git a/nfs/files/exports b/nfs/files/exports new file mode 100644 index 0000000..e69de29 diff --git a/nfs/files/nfs.sysconfig b/nfs/files/nfs.sysconfig new file mode 100644 index 0000000..2fcec19 --- /dev/null +++ b/nfs/files/nfs.sysconfig @@ -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" +# diff --git a/nfs/manifests/init.pp b/nfs/manifests/init.pp new file mode 100644 index 0000000..1f0fd55 --- /dev/null +++ b/nfs/manifests/init.pp @@ -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"], + } + +}