Home/
Blog/
Important step if you want to use the chef database cookbook with postgresql
I ran across this today while trying to use the chef community database cookbook. If you want to use it along with a postgresql database to e.g. create databases and create and assign roles to users, then you may need to do the following, at least with the chef 11.04 client running against a 10.18.2 server, which is my setup:
- You will need to have your role have recipe[postgresql::ruby] in its run list before the database cookbook in the role file that uses database, or otherwise set up your chef environment have it run earlier in the order
- In your recipe where you do your postgresql setup work, include the command chef_gem 'pg' before you use any of the database cookbook commands