-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0cc89ec
commit af33ea7
Showing
2 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# == Class icingaweb2::mod::monitoring | ||
# | ||
class icingaweb2::mod::monitoring ( | ||
$web_root = $::icingaweb2::params::web_root, | ||
) { | ||
require ::icingaweb2 | ||
|
||
File { | ||
require => Class['::icingaweb2::config'], | ||
owner => $::icingaweb2::config_user, | ||
group => $::icingaweb2::config_group, | ||
mode => $::icingaweb2::config_file_mode, | ||
} | ||
|
||
file { "${::icingaweb2::config_dir}/modules/monitoring": | ||
ensure => directory, | ||
mode => $::icingaweb2::config_dir_mode; | ||
} | ||
|
||
Ini_Setting { | ||
ensure => present, | ||
require => File["${::icingaweb2::config_dir}/modules/monitoring"], | ||
} | ||
|
||
ini_setting { 'security settings': | ||
section => 'security', | ||
setting => 'protected_customvars', | ||
value => '"*pw*,*pass*,community"', | ||
path => "${::icingaweb2::config_dir}/modules/monitoring/config.ini", | ||
} | ||
|
||
ini_setting { 'backend ido setting': | ||
section => 'icinga_ido', | ||
setting => 'type', | ||
value => 'ido', | ||
path => "${::icingaweb2::config_dir}/modules/monitoring/backends.ini", | ||
} | ||
|
||
ini_setting { 'backend resource setting': | ||
section => 'icinga_ido', | ||
setting => 'resource', | ||
value => 'icinga_ido', | ||
path => "${::icingaweb2::config_dir}/modules/monitoring/backends.ini", | ||
} | ||
|
||
ini_setting { 'command transport setting': | ||
section => 'icinga2', | ||
setting => 'transport', | ||
value => 'local', | ||
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', | ||
path => "${::icingaweb2::config_dir}/modules/monitoring/commandtransports.ini", | ||
} | ||
|
||
file { "${::icingaweb2::config_dir}/enabledModules/monitoring": | ||
ensure => link, | ||
target => '/usr/share/icingaweb2/modules/monitoring' | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
require 'spec_helper' | ||
|
||
describe 'icingaweb2::mod::monitoring', :type => :class do | ||
let (:pre_condition) { '$concat_basedir = "/tmp"' } | ||
let (:facts) { debian_facts } | ||
|
||
let :pre_condition do | ||
'include ::icingaweb2' | ||
end | ||
|
||
describe 'without parameters' do | ||
it { should contain_ini_setting('security settings').with( | ||
'section' => /security/, | ||
'setting' => /protected_customvars/, | ||
'value' => /community/, | ||
'path' => /config.ini/ | ||
) | ||
} | ||
it { should contain_ini_setting('backend ido setting').with( | ||
'section' => /icinga_ido/, | ||
'setting' => /type/, | ||
'value' => /ido/, | ||
'path' => /backends.ini/ | ||
) | ||
} | ||
it { should contain_ini_setting('backend resource setting').with( | ||
'section' => /icinga_ido/, | ||
'setting' => /resource/, | ||
'value' => /icinga_ido/, | ||
'path' => /backends.ini/ | ||
) | ||
} | ||
it { should contain_ini_setting('command transport setting').with( | ||
'section' => /icinga2/, | ||
'setting' => /transport/, | ||
'value' => /local/, | ||
'path' => /commandtransports.ini/ | ||
|
||
) | ||
} | ||
|
||
end | ||
|
||
end |