Puppet Class: nfs::server::service

Defined in:
manifests/server/service.pp

Summary

Overview

Class: nfs::server::service

This Function exists to

1. manage the needed services for nfs server

Author:



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
# File 'manifests/server/service.pp', line 11

class nfs::server::service {
  if $nfs::nfs_v4 == true {
    if $nfs::server_nfsv4_servicehelper != undef and $nfs::manage_server_servicehelper {
      $server_service_require = Service[$nfs::server_nfsv4_servicehelper]
      $nfs::server_nfsv4_servicehelper.each |$service_name| {
        service { $service_name:
          ensure     => $nfs::server_service_ensure,
          enable     => $nfs::server_service_enable,
          hasrestart => $nfs::server_service_hasrestart,
          hasstatus  => $nfs::server_service_hasstatus,
          subscribe  => [Concat[$nfs::exports_file], Augeas[$nfs::idmapd_file]],
        }
      }
    } else {
      $server_service_require = undef
    }

    if $nfs::manage_server_service {
      service { $nfs::server_service_name:
        ensure     => $nfs::server_service_ensure,
        enable     => $nfs::server_service_enable,
        hasrestart => $nfs::server_service_hasrestart,
        hasstatus  => $nfs::server_service_hasstatus,
        restart    => $nfs::server_service_restart_cmd,
        subscribe  => [Concat[$nfs::exports_file], Augeas[$nfs::idmapd_file]],
        require    => $server_service_require,
      }
    }
  } else {
    if $nfs::manage_server_service {
      service { $nfs::server_service_name:
        ensure     => $nfs::server_service_ensure,
        enable     => $nfs::server_service_enable,
        hasrestart => $nfs::server_service_hasrestart,
        hasstatus  => $nfs::server_service_hasstatus,
        restart    => $nfs::server_service_restart_cmd,
        subscribe  => Concat[$nfs::exports_file],
      }
    }
  }
}