Puppet Class: autofs::service

Defined in:
manifests/service.pp

Summary

The autofs::service class configures the autofs service.

Overview

This class can be used to disable or limit the autofs service if necessary. Such as allowing the service to run, but not at startup.

This class is private and cannot be called outside of the autofs module

See Also:

Author:

  • Vox Pupuli <voxpupuli@groups.io>

  • David Hollinger III <david.hollinger@moduletux.com>



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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'manifests/service.pp', line 19

class autofs::service {
  assert_private('Service class is private, please use main class parameters.')

  if $autofs::manage_service_config {
    # Only manage the file if the path is set
    if $autofs::service_conf_path {
      file { 'autofs_service_config':
        ensure  => 'file',
        content => epp(
          'autofs/service_conf.epp',
          {
            service_conf_options    => $autofs::service_conf_options,
            service_options         => $autofs::service_options,
            service_use_misc_device => $autofs::service_use_misc_device,
          }
        ),
        group   => $autofs::map_file_group,
        mode    => '0644',
        notify  => Service[$autofs::service_name],
        owner   => $autofs::map_file_owner,
        path    => $autofs::service_conf_path,
      }
    }
  }

  if $autofs::manage_ldap_auth_conf {
    # Only manage the file if the path is set
    if $autofs::ldap_auth_conf_path {
      file { 'autofs_ldap_auth_config':
        ensure  => 'file',
        content => epp(
          'autofs/autofs_ldap_auth.conf.epp', {
            ldap_auth_config => $autofs::ldap_auth_config,
          }
        ),
        group   => $autofs::map_file_group,
        mode    => '0600',
        notify  => Service[$autofs::service_name],
        owner   => $autofs::map_file_owner,
        path    => $autofs::ldap_auth_conf_path,
      }
    }
  }

  service { $autofs::service_name:
    ensure     => $autofs::service_ensure,
    enable     => $autofs::service_enable,
    hasstatus  => true,
    hasrestart => true,
    require    => Class['autofs::package'],
  }

  if $autofs::automountd_service_name {
    service { $autofs::automountd_service_name:
      ensure => $autofs::automountd_service_ensure,
      enable => $autofs::service_enable,
    }
  }

  if $autofs::autounmountd_service_name {
    service { $autofs::autounmountd_service_name:
      ensure => $autofs::autounmountd_service_ensure,
      enable => $autofs::service_enable,
    }
  }

  if $autofs::reload_command {
    exec { 'automount-reload':
      path        => '/sbin:/usr/sbin',
      command     => $autofs::reload_command,
      refreshonly => true,
      require     => Service[$autofs::service_name],
    }
  }
}