Puppet Class: nfs::server::redhat

Defined in:
manifests/server/redhat.pp

Overview

Parameters:

  • nfs_v4 (Any) (defaults to: false)
  • nfs_v4_idmap_domain (Any) (defaults to: undef)
  • mountd_port (Any) (defaults to: undef)
  • mountd_threads (Any) (defaults to: undef)
  • service_manage (Any) (defaults to: true)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'manifests/server/redhat.pp', line 1

class nfs::server::redhat (
  $nfs_v4              = false,
  $nfs_v4_idmap_domain = undef,
  $mountd_port         = undef,
  $mountd_threads      = undef,
  $service_manage      = true,) {

  if !defined(Class['nfs::client::redhat']) {
    class { 'nfs::client::redhat':
      nfs_v4              => $nfs_v4,
      nfs_v4_idmap_domain => $nfs_v4_idmap_domain,
    }
  }

  if $::operatingsystemmajrelease and $::operatingsystemmajrelease =~ /^7/ {
    $service_name = 'nfs-server'

  } else {
    $service_name = 'nfs'

  }

  if ($mountd_port != undef) {
    file_line { 'rpc-mount-options-port':
      ensure  => present,
      path    => '/etc/sysconfig/nfs',
      line    => "MOUNTD_PORT=${mountd_port}",
      match   => '^#?MOUNTD_PORT',
      require => Package['nfs-utils'];
    }

    if $service_manage {
      File_line['rpc-mount-options-port'] ~> Service[$service_name]
    }
  }

  if ($mountd_threads != undef) {
    file_line { 'rpc-mount-options-threads':
      ensure  => present,
      path    => '/etc/sysconfig/nfs',
      line    => "RPCNFSDCOUNT=${mountd_threads}",
      match   => '^#?RPCNFSDCOUNT=',
      require => Package['nfs-utils'];
    }

    if $service_manage {
      File_line['rpc-mount-options-threads'] ~> Service[$service_name]
    }
  }

  include nfs::server::redhat::install, nfs::server::redhat::service

}