hw-cookbooks/postgresql — pull request #200 by aclowes (2014-10-14 18:04:13+00:00)
Title: If not assigning a password, skip chef-solo check and node.save

This change wraps the chef-solo postgres password check and the code that sets the password attribute in an if statement: if we are not setting the postgres password, skip these operations.

Ideally I think we should get rid of both these operations:
- The chef-solo check is not needed because the assign-postgres-password resource always runs, does not check if the password has changed, and does not need authentication itself. Therefore it shouldn't matter if we are changing the password with every chef-solo run.
- The node.save() statement is unusual behavior ever since chef 10, when they switched to only saving node attributes if the run was successful. I don't think this use case warrants disregarding the convention, and if so it should be feature flagged.

I've done the minimal change but if others suggest a more extensive change, such as not setting the password by default or removing the save and solo check completely, I'd be happy to do those.