module-puppetdb/manifests/server/validate_db.pp
Ken Barber f6f6e55b33 Cleanups, missing doc items and new test_url capability
This provides a number of cleanups as the code has been unloved for a while.

I've added the ssl-* parameters the robinbowes added in his last patch to the
docs, and found some other cleanups as well where applicable.

I've added the ability to override the test_url also, so that in the future
if a user wishes to they can customize this.

Signed-off-by: Ken Barber <ken@bob.sh>
2014-10-07 15:06:54 +01:00

25 lines
1 KiB
Puppet

# This validates a database connection. See README.md for more details.
class puppetdb::server::validate_db (
$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,
$database_name = $puppetdb::params::database_name,
$database_ssl = $puppetdb::params::database_ssl,
) inherits puppetdb::params {
# We don't need any validation for the embedded database, presumably.
if (
$database == 'postgres' and
($database_password != undef and $database_ssl == false)
) {
postgresql::validate_db_connection { 'validate puppetdb postgres connection':
database_host => $database_host,
database_port => $database_port,
database_username => $database_username,
database_password => $database_password,
database_name => $database_name,
}
}
}