Puppet Class: puppet_ent_agent::config

Defined in:
manifests/config.pp

Overview

manages puppet.conf



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

class puppet_ent_agent::config {
  $config                  = $::puppet_ent_agent::config
  $agent_server            = $::puppet_ent_agent::agent_server
  $agent_caserver          = $::puppet_ent_agent::agent_caserver
  $agent_environment       = $::puppet_ent_agent::agent_environment
  $agent_fileserver        = $::puppet_ent_agent::agent_fileserver
  $agent_splay             = $::puppet_ent_agent::agent_splay
  $agent_remove_modulepath = $::puppet_ent_agent::agent_remove_modulepath
  $manage_symlinks         = $::puppet_ent_agent::manage_symlinks
  $service_name            = $::puppet_ent_agent::service_name
  $skip_service            = $::puppet_ent_agent::skip_service

  assert_private()

  if $skip_service {
    Ini_setting {
      ensure  => present,
      path    => $config,
      section => 'main',
    }
  } else {
    Ini_setting {
      ensure  => present,
      path    => $config,
      section => 'main',
      notify  => Service[$service_name],
    }
  }

  if $agent_server {
    ini_setting { 'agent_server':
      setting => 'server',
      value   => $agent_server,
    }
  }

  if $agent_caserver {
    ini_setting { 'agent_caserver':
      setting => 'ca_server',
      value   => $agent_caserver,
    }
  }

  if $agent_fileserver {
    ini_setting { 'agent_fileserver':
      setting => 'archive_file_server',
      value   => $agent_fileserver,
    }
  }

  if $agent_environment {
    ini_setting { 'agent_environment':
      section => 'agent',
      setting => 'environment',
      value   => $agent_environment,
    }
  }

  if $agent_splay == undef {
    ini_setting { 'agent_splay':
      ensure  => absent,
      setting => 'splay'
    }
  }
  else {
    #
    # The quotes around $agent_splay matter
    # as they convert the bool to a string
    # for proper handling by inifile module
    #
    # lint:ignore:only_variable_string
    ini_setting { 'agent_splay':
      setting => 'splay',
      value   => "${agent_splay}",
    }
    # lint:endignore
  }

  if $agent_remove_modulepath {
    ini_setting { 'agent_modulepath':
      ensure  => absent,
      setting => 'modulepath',
    }
  }

  unless $::osfamily == 'windows' {
    if $manage_symlinks {
      include ::puppet_ent_agent::config::symlinks
    }
  }
}