postgresqlchef-infrachef-recipe

Setup basic postgres database using Chef


I am trying to set up a very basic postgres database using Chef, but lack the Chef experience to make sense of the documentation I find in the supermarket's cookbook readme: https://supermarket.chef.io/cookbooks/postgresql

What I require is the chef equivalent of the following:

I would expect to be able to google an example of something as basic as this, but currently get lost in all the possible ways of configuring postgresql that I don't find a starting point. If another cookbook would make more sense please explain why.


Solution

  • We don't currently have a great answer for making the DB user and database. The old database cookbook used to handle that, but the code was so unmaintainable we felt obligated to deprecate it without a replacement plan. It does still exist and should proooobably work, but it's not a Delightful experience :( For the hba config, you can control that using the postgresql cookbook and some node attributes and similarly that will handle starting the database service for you.