phlipper/chef-postgresql — pull request #40 by sethcall (2013-07-25 21:59:24+00:00)
Title: * relying on node to iterate over custom configurations so that other re...

I removed the passed-in variable 'configuration' to the 'custom' postgresql template.

The problem is this: the variable is evaluated at the very moment this recipe is evaluated (during the compile phase), and so if another recipe during the compile phase tries to manipulate some key/value in node["postgresql"]["conf"] after the postgresql cookbook has run, then these changes are not seen at all by the custom template.

The fix is to just used node['postgresql']['conf'], because that's basically the only safe way to let every one have their chance at manipulating the node values during the compile phase.

If curious, I encountered this when trying to make the https://github.com/house9/wal-e-cookbook cookbook work with this postgresql cookbook (it supports the opscode one already, but I much prefer yours). The wal-e cookbook makes use of node.set[] to muck with the postgresql cookbook--and after much debugging I realized this was the issue.