module-icingaweb2/manifests/config/resource_database.pp
2015-04-23 11:40:42 +02:00

60 lines
1.5 KiB
Puppet

# Define for setting IcingaWeb2 Database Resource
#
define icingaweb2::config::resource_database (
$resource_db = undef,
$resource_dbname = undef,
$resource_host = undef,
$resource_name = $title,
$resource_password = undef,
$resource_port = undef,
$resource_username = undef,
) {
Ini_Setting {
ensure => present,
require => File["${::icingaweb2::config_dir}/resources.ini"],
path => "${::icingaweb2::config_dir}/resources.ini",
}
ini_setting { "icingaweb2 resources ${title} type":
section => $resource_name,
setting => 'type',
value => 'db',
}
ini_setting { "icingaweb2 resources ${title} db":
section => $resource_name,
setting => 'db',
value => "\"${resource_db}\"",
}
ini_setting { "icingaweb2 resources ${title} host":
section => $resource_name,
setting => 'host',
value => "\"${resource_host}\"",
}
ini_setting { "icingaweb2 resources ${title} port":
section => $resource_name,
setting => 'port',
value => "\"${resource_port}\"",
}
ini_setting { "icingaweb2 resources ${title} dbname":
section => $resource_name,
setting => 'dbname',
value => "\"${resource_dbname}\"",
}
ini_setting { "icingaweb2 resources ${title} username":
section => $resource_name,
setting => 'username',
value => "\"${resource_username}\"",
}
ini_setting { "icingaweb2 resources ${title} password":
section => $resource_name,
setting => 'password',
value => "\"${resource_password}\"",
}
}