/
params.pp
118 lines (106 loc) · 4.53 KB
/
params.pp
1
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
# File:: <tt>params.pp</tt>
# Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
# Copyright:: Copyright (c) 2016 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
# License:: Gpl-3.0
#
# ------------------------------------------------------------------------------
# = Class: ganglia::params
#
# In this class are defined as variables values that are used in other
# ganglia classes.
# This class should be included, where necessary, and eventually be enhanced
# with support for more OS
#
# == Warnings
#
# /!\ Always respect the style guide available
# here[http://docs.puppetlabs.com/guides/style_guide]
#
# The usage of a dedicated param classe is advised to better deal with
# parametrized classes, see
# http://docs.puppetlabs.com/guides/parameterized_classes.html
#
# [Remember: No empty lines between comments and class definition]
#
class ganglia::params {
######## DEFAULTS FOR VARIABLES USERS CAN SET ##########################
# (Here are set the defaults, provide your custom variables externally)
# (The default used is in the line with '')
###########################################
# ensure the presence (or absence) of ganglia
$ensure = 'present'
$gridname = ''
# External URL location of the ganglia server
$external_location = 'http://localhost/ganglia-2'
#### MODULE INTERNAL VARIABLES #########
# (Modify to adapt to unsupported OSes)
#######################################
# ganglia packages
$packagename = $::operatingsystem ? {
/(?i-mx:ubuntu|debian)/ => 'ganglia-monitor',
/(?i-mx:centos|fedora|redhat)/ => 'ganglia-gmond',
default => 'ganglia-monitor'
}
$serverpackagename = $::operatingsystem ? {
/(?i-mx:ubuntu|debian)/ => 'ganglia-webfrontend',
/(?i-mx:centos|fedora|redhat)/ => 'ganglia-web',
default => 'ganglia-webfrontend'
}
# ganglia associated services
$servicename = $::operatingsystem ? {
/(?i-mx:ubuntu|debian)/ => 'ganglia-monitor',
/(?i-mx:centos|fedora|redhat)/ => 'gmond',
default => 'ganglia-monitor'
}
$serverservicename = $::operatingsystem ? {
/(?i-mx:ubuntu|debian)/ => 'gmetad',
default => 'gmetad'
}
# ubuntu 12.10 and below didn't have a status command in the init script
if ! (($::operatingsystem == 'Ubuntu' and versioncmp($::lsbmajdistrelease, '12') > 0) or
($::operatingsystem == 'Debian' and $::lsbmajdistrelease != '7')) {
$gmond_status_command = 'pgrep -u ganglia -f /usr/sbin/gmond'
}
$ibgit = 'https://github.com/ULHPC/ganglia_infiniband_module'
$ibtarget = '/root/ganglia_infiniband_module'
$ibmakedep = $::operatingsystem ? {
/(?i-mx:ubuntu|debian)/ => ['gcc', 'libapr1-dev', 'libconfuse-dev', 'libexpat1-dev', 'libganglia1-dev'],
default => ['gcc', 'apr-devel', 'expat-devel', 'libconfuse-devel', 'ganglia-devel'],
} # + make, which is already defined in the generic module
$configfile = $::operatingsystem ? {
default => '/etc/ganglia/gmond.conf',
}
$serverconfigfile = $::operatingsystem ? {
default => '/etc/ganglia/gmetad.conf',
}
$webconfigfile = $::operatingsystem ? {
/(?i-mx:ubuntu|debian)/ => '/etc/ganglia-webfrontend/conf.php',
/(?i-mx:centos|fedora|redhat)/ => '/etc/ganglia/conf.php',
default => '/etc/ganglia-webfrontend/conf.php',
}
$apacheconfigfile = $::operatingsystem ? {
default => '/etc/ganglia-webfrontend/apache.conf',
}
$apachetarget = $::operatingsystem ? {
default => '/etc/apache2/conf.d',
}
$configfile_mode = $::operatingsystem ? {
default => '0644',
}
$configfile_owner = $::operatingsystem ? {
default => 'root',
}
$configfile_group = $::operatingsystem ? {
default => 'root',
}
$headertemplatefile = $::operatingsystem ? {
/(?i-mx:ubuntu|debian)/ => '/usr/share/ganglia-webfrontend/templates/default/header.tpl',
/(?i-mx:centos|fedora|redhat)/ => '/usr/share/ganglia/templates/default/header.tpl',
default => '/usr/share/ganglia-webfrontend/templates/default/header.tpl',
}
$cssfile = $::operatingsystem ? {
/(?i-mx:ubuntu|debian)/ => '/usr/share/ganglia-webfrontend/styles.css',
/(?i-mx:centos|fedora|redhat)/ => '/usr/share/ganglia/styles.css',
default => '/usr/share/ganglia-webfrontend/styles.css',
}
}