Puppet Class: pcp::config

Defined in:
manifests/config.pp

Overview



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

class pcp::config {
  file { '/etc/pcp/pmlogger/control.d':
    ensure  => $pcp::_directory_ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0755',
    recurse => true,
    purge   => true,
    force   => true,
  }

  if $pcp::include_default_pmlogger {
    pcp::pmlogger { 'local':
      ensure  => $pcp::_resource_ensure,
      primary => true,
      args    => '-r -T24h10m -c config.default',
    }
  }

  file { '/etc/pcp/pmie/control.d':
    ensure  => $pcp::_directory_ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0755',
    recurse => true,
    purge   => true,
    force   => true,
  }

  if $pcp::include_default_pmie {
    pcp::pmie { 'local':
      ensure  => $pcp::_resource_ensure,
      primary => true,
      args    => '-c config.default',
    }
  }

  file { '/etc/cron.d/pcp-pmlogger':
    ensure  => $pcp::_cron_file_ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template($pcp::pmlogger_cron_template),
  }

  file { '/etc/cron.d/pcp-pmie':
    ensure  => $pcp::_cron_file_ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template($pcp::pmie_cron_template),
  }

  if ! empty($pcp::pcp_conf_configs) {
    $pcp_conf_changes = $pcp::pcp_conf_configs.map |$key,$value| {
      "set ${key} '${value}'"
    }
    augeas { '/etc/pcp.conf':
      incl    => '/etc/pcp.conf',
      lens    => 'Shellvars.lns',
      changes => $pcp_conf_changes,
    }
  }
}