Puppet Class: pcp

Defined in:
manifests/init.pp

Summary

Manage PCP

Overview

Examples:

include ::pcp

Parameters:

  • ensure (Enum['running', 'stopped', 'absent']) (defaults to: 'running')

    Defines state of PCP.

  • package_ensure (String) (defaults to: 'present')

    Package ensure property.

  • packages (Array) (defaults to: ['pcp', 'pcp-conf', 'pcp-doc', 'pcp-libs', 'perl-PCP-PMDA', 'python-pcp', 'pcp-selinux'])

    Array of packages to install for PCP

  • extra_packages (Array) (defaults to: [])

    Extra packages to install

  • service_ensure (Optional[String]) (defaults to: undef)

    Set service ensure property for pmcd, pmie and pmlogger services. Default is based on ensure parameter.

  • service_enable (Optional[Boolean]) (defaults to: undef)

    Set service enable property for pmcd, pmie and pmlogger services. Default is based on ensure parameter.

  • enable_pmproxy (Boolean) (defaults to: false)

    Boolean that determines if pmproxy service is running/enabled.

  • manage_user (Boolean) (defaults to: true)

    Boolean that sets if pcp user / group is managed.

  • pcp_group_gid (Optional[Integer]) (defaults to: undef)

    pcp group GID.

  • pcp_user_uid (Optional[Integer]) (defaults to: undef)

    pcp user UID.

  • cron_ensure (Optional[String]) (defaults to: undef)

    Ensure passed to cron files. Default based on value of ensure.

  • pmlogger_cron_template (String) (defaults to: 'pcp/pcp-pmlogger.cron.erb')

    Template used for pmlogger cron.

  • pmie_cron_template (String) (defaults to: 'pcp/pcp-pmie.cron.erb')

    Template used for pmie cron.

  • include_default_pmlogger (Boolean) (defaults to: true)

    Boolean that determines if default install pmlogger is installed.

  • include_default_pmie (Boolean) (defaults to: true)

    Boolean that determines if default install pmie is installed.

  • pmlogger_daily_args (String) (defaults to: '-X xz -x 3')

    Arguments given to pmlogger_daily that is executed via cron.

  • pcp_conf_configs (Hash) (defaults to: {})

    Hash of configs to manage in /etc/pcp.conf.

  • pmdas (Hash) (defaults to: {})

    Hash that defines pcp::pmda resources.

  • pmies (Hash) (defaults to: {})

    Hash that defines pcp::pmie resources.

  • pmloggers (Hash) (defaults to: {})

    Hash that defines pcp::pmlogger resources.



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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'manifests/init.pp', line 50

class pcp (
  Enum['running', 'stopped', 'absent'] $ensure  = 'running',
  # Package
  String $package_ensure                        = 'present',
  Array $packages = ['pcp', 'pcp-conf', 'pcp-doc', 'pcp-libs', 'perl-PCP-PMDA', 'python-pcp', 'pcp-selinux'],
  Array $extra_packages = [],
  # Service
  Optional[String] $service_ensure              = undef,
  Optional[Boolean] $service_enable             = undef,
  Boolean $enable_pmproxy                       = false,
  # User
  Boolean $manage_user                          = true,
  Optional[Integer] $pcp_group_gid              = undef,
  Optional[Integer] $pcp_user_uid               = undef,
  # Config
  Optional[String] $cron_ensure                 = undef,
  String $pmlogger_cron_template                = 'pcp/pcp-pmlogger.cron.erb',
  String $pmie_cron_template                    = 'pcp/pcp-pmie.cron.erb',
  Boolean $include_default_pmlogger             = true,
  Boolean $include_default_pmie                 = true,
  String $pmlogger_daily_args                   = '-X xz -x 3',
  Hash $pcp_conf_configs                        = {},
  # Resources
  Hash $pmdas                                   = {},
  Hash $pmies                                   = {},
  Hash $pmloggers                               = {},
) {
  case $ensure {
    'running': {
      $_package_ensure    = $package_ensure
      $_directory_ensure  = 'directory'
      $_resource_ensure   = 'present'
      $_cron_default      = 'file'
      $_service_ensure_default  = 'running'
      $_service_enable_default  = true
    }
    'stopped': {
      $_package_ensure    = $package_ensure
      $_directory_ensure  = 'directory'
      $_resource_ensure   = 'present'
      $_cron_default      = 'absent'
      $_service_ensure_default  = 'stopped'
      $_service_enable_default  = false
    }
    'absent': {
      $_package_ensure    = 'absent'
      $_directory_ensure  = 'absent'
      $_resource_ensure   = 'absent'
      $_cron_default      = 'absent'
      $_service_ensure_default  = 'stopped'
      $_service_enable_default  = false
    }
    default: {
      fail("Module ${module_name}: ensure must be either running, stopped or absent.  ${ensure} given.")
    }
  }

  $_cron_file_ensure = pick($cron_ensure, $_cron_default)
  $_service_ensure = pick($service_ensure, $_service_ensure_default)
  $_service_enable = pick($service_enable, $_service_enable_default)

  contain pcp::user
  contain pcp::install
  contain pcp::config
  contain pcp::resources
  contain pcp::service

  Class['pcp::user']
  -> Class['pcp::install']
  -> Class['pcp::config']
  -> Class['pcp::resources']
  -> Class['pcp::service']
}