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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
# File 'manifests/params.pp', line 2
class collectd::params {
$autoloadplugin = false
$fqdnlookup = true
$collectd_hostname = $facts['networking']['hostname']
$conf_content = undef
$config_mode = '0640'
$config_owner = 'root'
$interval = 10
$include = []
$internal_stats = false
$purge = false
$purge_config = false
$recurse = false
$read_threads = 5
$write_threads = 5
$timeout = 2
$typesdb = ['/usr/share/collectd/types.db']
$write_queue_limit_high = undef
$write_queue_limit_low = undef
$package_ensure = 'present'
$service_ensure = 'running'
$service_enable = true
$minimum_version = '4.8'
$manage_package = true
$manage_service = true
$package_install_options = undef
$plugin_conf_dir_mode = '0750'
$ci_package_repo = undef
$package_keyserver = 'keyserver.ubuntu.com'
$utils = false
case $facts['kernel'] {
'OpenBSD': { $has_wordexp = false }
default: { $has_wordexp = true }
}
case $facts['os']['family'] {
'Debian': {
$package_name = ['collectd', 'collectd-core']
$package_provider = 'apt'
$collectd_dir = '/etc/collectd'
$plugin_conf_dir = "${collectd_dir}/conf.d"
$service_name = 'collectd'
$config_file = "${collectd_dir}/collectd.conf"
$config_group = 'root'
$java_dir = '/usr/share/collectd/java'
$default_python_dir = '/usr/local/lib/python2.7/dist-packages'
$manage_repo = $facts['os']['name'] ? {
'Ubuntu' => versioncmp($facts['os']['release']['full'], '18.04') < 0,
default => versioncmp($facts['os']['release']['full'], '11') < 0 ,
}
$package_configs = {}
}
'Solaris': {
$package_name = 'CSWcollectd'
$package_provider = 'pkgutil'
$collectd_dir = '/etc/opt/csw/collectd.d'
$plugin_conf_dir = $collectd_dir
$service_name = 'cswcollectd'
$config_file = '/etc/opt/csw/collectd.conf'
$config_group = 'root'
$java_dir = undef
$default_python_dir = '/opt/csw/share/collectd/python'
$manage_repo = false
$package_configs = {}
}
'RedHat': {
$package_name = 'collectd'
$package_provider = 'yum'
$collectd_dir = '/etc/collectd.d'
$plugin_conf_dir = $collectd_dir
$service_name = 'collectd'
$config_file = '/etc/collectd.conf'
$config_group = 'root'
$java_dir = '/usr/share/collectd/java'
$default_python_dir = $facts['os']['release']['major'] ? {
'7' => '/usr/lib/python2.7/site-packages',
default => '/usr/lib/python3.6/site-packages',
}
$manage_repo = true
$package_configs = {
ovs_events => 'ovs-events.conf',
ovs_stats => 'ovs-stats.conf',
processes => 'processes-config.conf',
virt => 'libvirt.conf',
}
}
'Suse': {
$package_name = 'collectd'
$package_provider = 'zypper'
$collectd_dir = '/etc/collectd'
$plugin_conf_dir = $collectd_dir
$service_name = 'collectd'
$config_file = '/etc/collectd.conf'
$config_group = 'root'
$java_dir = undef
$default_python_dir = '/usr/share/collectd/python'
$manage_repo = false
$package_configs = {}
}
'FreeBSD': {
$package_name = 'collectd5'
$package_provider = undef
$collectd_dir = '/usr/local/etc/collectd'
$plugin_conf_dir = $collectd_dir
$service_name = 'collectd'
$config_file = '/usr/local/etc/collectd.conf'
$config_group = 'wheel'
$java_dir = undef
$default_python_dir = '/usr/local/share/collectd/python'
$manage_repo = false
$package_configs = {}
}
'OpenBSD': {
$package_name = 'collectd'
$package_provider = undef
$collectd_dir = '/etc/collectd'
$plugin_conf_dir = $collectd_dir
$service_name = 'collectd'
$config_file = '/etc/collectd.conf'
$config_group = '_collectd'
$java_dir = undef
$default_python_dir = '/usr/local/share/collectd/python'
$manage_repo = false
$package_configs = {}
}
'Archlinux': {
$package_name = 'collectd'
$package_provider = undef
$collectd_dir = '/etc/collectd.d'
$plugin_conf_dir = $collectd_dir
$service_name = 'collectd'
$config_file = '/etc/collectd.conf'
$config_group = 'wheel'
$java_dir = undef
$default_python_dir = '/usr/share/collectd/python'
$manage_repo = false
$package_configs = {}
}
'Gentoo': {
$package_name = 'app-admin/collectd'
$package_provider = 'portage'
$collectd_dir = '/etc/collectd.d'
$plugin_conf_dir = $collectd_dir
$service_name = 'collectd'
$config_file = '/etc/collectd.conf'
$config_group = 'collectd'
$java_dir = undef
$default_python_dir = '/usr/share/collectd/python'
$manage_repo = false
$package_configs = {}
}
default: {
fail("${facts['os']['family']} is not supported.")
}
}
# Override with custom fact value (present only if python is installed)
$python_dir = pick($facts['python_dir'], $default_python_dir)
}
|