Puppet Class: nfs::client::service

Defined in:
manifests/client/service.pp

Summary

Manage the needed services for NFS clients.

Overview

Author:

    • Daniel Klockenkaemper <dk@marketing-factory.de>

    • Martin Alfke <tuxmea@gmail.com>



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

class nfs::client::service {
  if $nfs::client::nfs_v4 {
    $create_services = $nfs::effective_nfsv4_client_services

    if $nfs::server_enabled {
      $subscription = [Concat[$nfs::exports_file], Augeas[$nfs::idmapd_file]]
    } else {
      if ($nfs::client_rpcbind_config != undef)
      and ($nfs::client_rpcbind_optname != undef)
      and ($nfs::client_rpcbind_opts != undef) {
        $subscription = [
          Augeas[$nfs::idmapd_file],
          Augeas[$nfs::defaults_file],
          Augeas[$nfs::client_rpcbind_config],
        ]
      } else {
        $subscription = [
          Augeas[$nfs::idmapd_file],
          Augeas[$nfs::defaults_file],
        ]
      }
    }
  } else {
    $create_services = $nfs::effective_client_services

    if $nfs::server_enabled {
      $subscription = [Concat[$nfs::exports_file]]
    } else {
      $subscription = undef
    }
  }

  $service_defaults = {
    ensure     => running,
    enable     => $nfs::client_services_enable,
    hasrestart => $nfs::client_services_hasrestart,
    hasstatus  => $nfs::client_services_hasstatus,
    subscribe  => $subscription,
  }

  if $create_services != undef and $nfs::manage_client_service {
    create_resources('service', $create_services, $service_defaults )
  }
}