Resource Type: pg_validation
- Defined in:
- lib/puppet/type/pg_validation.rb
- Providers:
-
simple
Overview
This type allows you to validate the contents of your Postgres database. Here is an example on how you can use this:
pg_validation { 'Ensure rowlevel security NOT enabled/db@instance':
check => 'SELECT oid, relname, relrowsecurity FROM pg_class WHERE relrowsecurity IS TRUE;',
expected_number_of_rows => 0,
fail_message => 'table %<relname>s should not have rowlevel security enabled.',
report_as => 'command',
fail_command => "/bin/send_to_montoring --node ${::fqdn} '%<messages>s'",
}
The Puppet statement executes a query on the database and report a warning when more the 0 records are found. It uses the returned records of the query to generate a good reading error or warning message.