2013-10-21 17:21:12 +02:00
|
|
|
# This validates a database connection. See README.md for more details.
|
2014-10-07 16:06:54 +02:00
|
|
|
class puppetdb::server::validate_db (
|
2012-09-20 23:46:26 +02:00
|
|
|
$database = $puppetdb::params::database,
|
|
|
|
$database_host = $puppetdb::params::database_host,
|
|
|
|
$database_port = $puppetdb::params::database_port,
|
|
|
|
$database_username = $puppetdb::params::database_username,
|
|
|
|
$database_password = $puppetdb::params::database_password,
|
2013-08-21 10:37:34 +02:00
|
|
|
$database_name = $puppetdb::params::database_name,
|
2014-10-07 16:06:54 +02:00
|
|
|
$database_ssl = $puppetdb::params::database_ssl,
|
2012-09-18 00:26:32 +02:00
|
|
|
) inherits puppetdb::params {
|
2012-09-20 23:46:26 +02:00
|
|
|
|
|
|
|
# We don't need any validation for the embedded database, presumably.
|
2014-10-07 16:06:54 +02:00
|
|
|
if (
|
|
|
|
$database == 'postgres' and
|
|
|
|
($database_password != undef and $database_ssl == false)
|
2013-08-21 10:37:34 +02:00
|
|
|
) {
|
2013-04-08 23:49:18 +02:00
|
|
|
postgresql::validate_db_connection { 'validate puppetdb postgres connection':
|
2012-09-20 23:46:26 +02:00
|
|
|
database_host => $database_host,
|
|
|
|
database_port => $database_port,
|
|
|
|
database_username => $database_username,
|
|
|
|
database_password => $database_password,
|
|
|
|
database_name => $database_name,
|
2012-09-18 00:26:32 +02:00
|
|
|
}
|
2012-09-20 23:46:26 +02:00
|
|
|
}
|
2012-09-18 00:26:32 +02:00
|
|
|
}
|