Refactor debmon support

Signed-off-by: Nick Chappell <nick@intronic.org>
This commit is contained in:
Olivier FONTANNAUD 2014-10-03 11:26:10 +02:00 committed by Nick Chappell
parent e35c11aa21
commit 2826c0fa9f
4 changed files with 15 additions and 6 deletions

View file

@ -112,7 +112,7 @@ class { 'icinga2::server':
When the `server_db_type` parameter is set, the right IDO database connection packages are automatically installed and the schema is loaded.
If you want to use [Debmon repository](http://debmon.org/packages) for Debian 7, you have to set `use_debmon` to true when you call `icinga2::server` class.
If you want to use [Debmon repository](http://debmon.org/packages) for Debian 7, you have to set `use_debmon_repo` to true when you call `icinga2::server` class.
**Note:** For production use, you'll probably want to get the database password via a [Hiera lookup](http://docs.puppetlabs.com/hiera/1/puppet.html) so the password isn't sitting in your site manifests in plain text:

View file

@ -46,7 +46,7 @@ class icinga2::params {
#Whether to manage the package repositories
$manage_repos = true
$use_debmon = false
$use_debmon_repo = false
$server_db_type = 'pgsql'
$install_mail_utils_package = false

View file

@ -13,7 +13,7 @@
class icinga2::server (
$manage_repos = $icinga2::params::manage_repos,
$use_debmon = $icinga2::params::use_debmon,
$use_debmon_repo = $icinga2::params::use_debmon_repo,
$server_db_type = $icinga2::params::server_db_type,
$db_name = $icinga2::params::db_name,
$db_user = $icinga2::params::db_user,
@ -28,7 +28,7 @@ class icinga2::server (
#Do some validation of parameters so we know we have the right data types:
validate_bool($manage_repos)
validate_bool($use_debmon)
validate_bool($use_debmon_repo)
validate_string($server_db_type)
validate_string($db_name)
validate_string($db_user)

View file

@ -57,10 +57,19 @@ class icinga2::server::install::repos inherits icinga2::server {
#Debian systems:
'Debian': {
#On Debian (7) icinga2 packages are on backports
if $use_debmon == false {
if $use_debmon_repo == false {
include apt::backports
} else {
include icinga2::server::debmon_repo
apt::source { 'debmon':
location => 'http://debmon.org/debmon',
release => "debmon-${lsbdistcodename}",
repos => 'main',
key_source => 'http://debmon.org/debmon/repo.key',
key => 'BC7D020A',
include_src => false,
# backports repo use 200
pin => '300'
}
}
}