|
1 # Class: puppi::params |
|
2 # |
|
3 # Sets internal variables and defaults for puppi module |
|
4 # |
|
5 class puppi::params { |
|
6 |
|
7 ## PARAMETERS |
|
8 $version = '1' |
|
9 $install_dependencies = true |
|
10 $template = 'puppi/puppi.conf.erb' |
|
11 $helpers_class = 'puppi::helpers' |
|
12 $logs_retention_days = '30' |
|
13 $extra_class = 'puppi::extras' |
|
14 |
|
15 |
|
16 ## INTERNALVARS |
|
17 $basedir = '/etc/puppi' |
|
18 $scriptsdir = '/etc/puppi/scripts' |
|
19 $checksdir = '/etc/puppi/checks' |
|
20 $logsdir = '/etc/puppi/logs' |
|
21 $infodir = '/etc/puppi/info' |
|
22 $tododir = '/etc/puppi/todo' |
|
23 $projectsdir = '/etc/puppi/projects' |
|
24 $datadir = '/etc/puppi/data' |
|
25 $helpersdir = '/etc/puppi/helpers' |
|
26 $libdir = '/var/lib/puppi' |
|
27 $readmedir = '/var/lib/puppi/readme' |
|
28 $logdir = '/var/log/puppi' |
|
29 |
|
30 $archivedir = $::puppi_archivedir ? { |
|
31 '' => '/var/lib/puppi/archive', |
|
32 undef => '/var/lib/puppi/archive', |
|
33 default => $::puppi_archivedir, |
|
34 } |
|
35 |
|
36 $workdir = $::puppi_workdir ? { |
|
37 '' => '/tmp/puppi', |
|
38 undef => '/tmp/puppi', |
|
39 default => $::puppi_workdir, |
|
40 } |
|
41 |
|
42 $configfile_mode = '0644' |
|
43 $configfile_owner = 'root' |
|
44 $configfile_group = 'root' |
|
45 |
|
46 # External tools |
|
47 # Directory where are placed the checks scripts |
|
48 # By default we use Nagios plugins |
|
49 $checkpluginsdir = $::operatingsystem ? { |
|
50 /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => $::architecture ? { |
|
51 x86_64 => '/usr/lib64/nagios/plugins', |
|
52 default => '/usr/lib/nagios/plugins', |
|
53 }, |
|
54 default => '/usr/lib/nagios/plugins', |
|
55 } |
|
56 |
|
57 $package_nagiosplugins = $::operatingsystem ? { |
|
58 /(?i:RedHat|CentOS|Scientific|Amazon|Linux|Fedora)/ => 'nagios-plugins-all', |
|
59 default => 'nagios-plugins', |
|
60 } |
|
61 |
|
62 $package_mail = $::operatingsystem ? { |
|
63 /(?i:Debian|Ubuntu|Mint)/ => 'bsd-mailx', |
|
64 default => 'mailx', |
|
65 } |
|
66 |
|
67 $ntp = $::ntp_server ? { |
|
68 '' => 'pool.ntp.org' , |
|
69 default => is_array($::ntp_server) ? { |
|
70 false => $::ntp_server, |
|
71 true => $::ntp_server[0], |
|
72 default => $::ntp_server, |
|
73 } |
|
74 } |
|
75 |
|
76 # Mcollective paths |
|
77 # TODO: Add Paths for Puppet Enterprise: |
|
78 # /opt/puppet/libexec/mcollective/mcollective/ |
|
79 $mcollective = $::operatingsystem ? { |
|
80 debian => '/usr/share/mcollective/plugins/mcollective', |
|
81 ubuntu => '/usr/share/mcollective/plugins/mcollective', |
|
82 centos => '/usr/libexec/mcollective/mcollective', |
|
83 redhat => '/usr/libexec/mcollective/mcollective', |
|
84 default => '/usr/libexec/mcollective/mcollective', |
|
85 } |
|
86 |
|
87 $mcollective_user = 'root' |
|
88 $mcollective_group = 'root' |
|
89 |
|
90 |
|
91 # Commands used in puppi info templates |
|
92 $info_package_query = $::operatingsystem ? { |
|
93 /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => 'rpm -qi', |
|
94 /(?i:Ubuntu|Debian|Mint)/ => 'dpkg -s', |
|
95 default => 'echo', |
|
96 } |
|
97 $info_package_list = $::operatingsystem ? { |
|
98 /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => 'rpm -ql', |
|
99 /(?i:Ubuntu|Debian|Mint)/ => 'dpkg -L', |
|
100 default => 'echo', |
|
101 } |
|
102 $info_service_check = $::operatingsystem ? { |
|
103 default => '/etc/init.d/', |
|
104 } |
|
105 |
|
106 } |