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']
}
|