Skip to content

Commit

Permalink
Add parameters to the monitoring module class for more flexibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziaunys authored and arioch committed Feb 23, 2016
1 parent eb61819 commit 167a752
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions manifests/mod/monitoring.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# == Class icingaweb2::mod::monitoring
#
class icingaweb2::mod::monitoring (
$protected_customvars = '*pw*,*pass*,community',
$backend_type = 'ido',
$backend_resource = 'icinga_ido',
$transport = 'local',
$transport_path = '/var/run/icinga2/cmd/icinga2.cmd',
) {
require ::icingaweb2

Expand All @@ -26,6 +31,16 @@
mode => $::icingaweb2::config_dir_mode;
}

$monitoring_mod_files = [
"${::icingaweb2::config_dir}/modules/monitoring/backends.ini",
"${::icingaweb2::config_dir}/modules/monitoring/config.ini",
"${::icingaweb2::config_dir}/modules/monitoring/commandtransports.ini",
]

file { $monitoring_mod_files:
ensure => present,
}

Ini_Setting {
ensure => present,
require => File["${::icingaweb2::config_dir}/modules/monitoring"],
Expand All @@ -34,35 +49,35 @@
ini_setting { 'security settings':
section => 'security',
setting => 'protected_customvars',
value => '"*pw*,*pass*,community"',
value => "\"${protected_customvars}\"",
path => "${::icingaweb2::config_dir}/modules/monitoring/config.ini",
}

ini_setting { 'backend ido setting':
section => 'icinga_ido',
setting => 'type',
value => 'ido',
value => $backend_type,
path => "${::icingaweb2::config_dir}/modules/monitoring/backends.ini",
}

ini_setting { 'backend resource setting':
section => 'icinga_ido',
setting => 'resource',
value => 'icinga_ido',
value => $backend_resource,
path => "${::icingaweb2::config_dir}/modules/monitoring/backends.ini",
}

ini_setting { 'command transport setting':
section => 'icinga2',
setting => 'transport',
value => 'local',
value => $transport,
path => "${::icingaweb2::config_dir}/modules/monitoring/commandtransports.ini",
}

ini_setting { 'command transport path setting':
section => 'icinga2',
setting => 'path',
value => '/var/run/icinga2/cmd/icinga2.cmd',
value => $transport_path,
path => "${::icingaweb2::config_dir}/modules/monitoring/commandtransports.ini",
}

Expand Down

0 comments on commit 167a752

Please sign in to comment.