From 438ebb72ce01d9ecc6c0dd374d8e5443a6899576 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Tue, 27 Jul 2010 08:59:23 +0100 Subject: [PATCH] Add nfs-server module. Still needs menu.lst modification manually for moduleless kernels. Signed-off-by: Stephen Gran --- modules/nfs-server/files/lockd.local.modprobe | 1 + modules/nfs-server/files/nfs-common.default | 19 ++++++++++++ .../files/nfs-kernel-server.default | 18 +++++++++++ modules/nfs-server/manifests/init.pp | 31 +++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 modules/nfs-server/files/lockd.local.modprobe create mode 100644 modules/nfs-server/files/nfs-common.default create mode 100644 modules/nfs-server/files/nfs-kernel-server.default create mode 100644 modules/nfs-server/manifests/init.pp diff --git a/modules/nfs-server/files/lockd.local.modprobe b/modules/nfs-server/files/lockd.local.modprobe new file mode 100644 index 000000000..fc6f11fb6 --- /dev/null +++ b/modules/nfs-server/files/lockd.local.modprobe @@ -0,0 +1 @@ +options lockd nlm_udpport=10003 nlm_tcpport=10003 diff --git a/modules/nfs-server/files/nfs-common.default b/modules/nfs-server/files/nfs-common.default new file mode 100644 index 000000000..8e04ee376 --- /dev/null +++ b/modules/nfs-server/files/nfs-common.default @@ -0,0 +1,19 @@ +# If you do not set values for the NEED_ options, they will be attempted +# autodetected; this should be sufficient for most people. Valid alternatives +# for the NEED_ options are "yes" and "no". + +# Do you want to start the statd daemon? It is not needed for NFSv4. +NEED_STATD= + +# Options for rpc.statd. +# Should rpc.statd listen on a specific port? This is especially useful +# when you have a port-based firewall. To use a fixed port, set this +# this variable to a statd argument like: "--port 4000 --outgoing-port 4001". +# For more information, see rpc.statd(8) or http://wiki.debian.org/?SecuringNFS +STATDOPTS='--port 10000 -o 10001' + +# Do you want to start the idmapd daemon? It is only needed for NFSv4. +NEED_IDMAPD= + +# Do you want to start the gssd daemon? It is required for Kerberos mounts. +NEED_GSSD= diff --git a/modules/nfs-server/files/nfs-kernel-server.default b/modules/nfs-server/files/nfs-kernel-server.default new file mode 100644 index 000000000..a6f2d4202 --- /dev/null +++ b/modules/nfs-server/files/nfs-kernel-server.default @@ -0,0 +1,18 @@ +# Number of servers to start up +RPCNFSDCOUNT=8 + +# Runtime priority of server (see nice(1)) +RPCNFSDPRIORITY=0 + +# Options for rpc.mountd. +# If you have a port-based firewall, you might want to set up +# a fixed port here using the --port option. For more information, +# see rpc.mountd(8) or http://wiki.debian.org/?SecuringNFS +RPCMOUNTDOPTS="-p 10002" + +# Do you want to start the svcgssd daemon? It is only required for Kerberos +# exports. Valid alternatives are "yes" and "no"; the default is "no". +NEED_SVCGSSD= + +# Options for rpc.svcgssd. +RPCSVCGSSDOPTS= diff --git a/modules/nfs-server/manifests/init.pp b/modules/nfs-server/manifests/init.pp new file mode 100644 index 000000000..586bcb530 --- /dev/null +++ b/modules/nfs-server/manifests/init.pp @@ -0,0 +1,31 @@ +class nfs-server { + + include ferm::nfs-server + + package { + nfs-common: ensure => installed; + nfs-kernel-server: ensure => installed; + } + + file { + "/etc/default/nfs-common": + source => "puppet:///nfs-server/nfs-common.default"), + require => Package["nfs-common"], + notify => Exec["nfs-common restart"]; + "/etc/default/nfs-kernel-server": + source => "puppet:///nfs-server/nfs-kernel-server.default"), + require => Package["nfs-kernel-server"], + notify => Exec["nfs-kernel-server restart"]; + "/etc/modprobe.d/lockd.local": + source => "puppet:///nfs-server/lockd.local.modprobe"); + } + + exec { + "nfs-common restart": + path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin", + refreshonly => true; + "nfs-kernel-server restart": + path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin", + refreshonly => true; + } +} -- 2.20.1