Puppet Class: puppet::agent::service

Defined in:
manifests/agent/service.pp

Overview

Class: puppet::agent::service

Manages enabling and disabling the Puppet agent service

Parameters:

  • enable (Any) (defaults to: true)


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

class puppet::agent::service (
  $enable = true
) {

  include puppet::params

  if $enable {
    $ensure = running
  } else {
    $ensure = stopped
  }

  # ----
  # Puppet agent management
  service { 'puppet_agent':
    ensure     => $ensure,
    name       => $puppet::params::agent_service,
    enable     => $enable,
    hasstatus  => true,
    hasrestart => true,
  }

  # ----
  # Special things for special kernels
  case $::kernel {
    linux: {
      if $puppet::params::agent_service_conf {
        file { 'puppet_agent_service_conf':
          mode    => '0644',
          owner   => 'root',
          group   => 'root',
          content => template('puppet/agent_service.erb'),
          path    => $puppet::params::agent_service_conf,
        }
      }
    }
    darwin: {
      file { 'com.puppetlabs.puppet.plist':
        owner   => 'root',
        group   => '0',
        mode    => '0640',
        source  => 'puppet:///modules/puppet/com.puppetlabs.puppet.plist',
        path    => '/Library/LaunchDaemons/com.puppetlabs.puppet.plist',
      }
    }
  }
}