puppetlabs/puppet-postgresql — pull request #152 by kostecky (2013-03-12 21:11:57+00:00)
Title: Absent support for roles, databases, grants that required a psql refactor to replace postgresql_psql

This adds absent support for roles, databases, and grants.

I looked over the postgresql_psql type and determined there was no need to implement this. It's essentially mimicking the exec type that is already a puppet builtin without all the safety features necessary to make it a robust type.

I've implemented "onlyif", "unless" and "refreshonly" properly. I ran in to some bugs in the pre-forked version with refreshonly in certain circumstances that needed to be fixed.

I refactored the psql type and adjusted the module to use that instead. It's more robust with the only CAVEAT being that there is still the original issue of proper quoting. This doesn't need to be handled in a ruby newtype(). A ruby function can be created that is used within the postgresql::psql() type that is a wrapper for exec to do proper quoting.

This should be a drop-in replacement if you/we decide to replace the newtype work that was done.