On the Puppet forge there are already some modules available that can help you install the postgres software on your system. Most of these modules, however, are missing facilities for you to create and configure databases.
The pg_config module is the missing link. This module extends the puppet language so that Puppet knows about Postgres and the things to manage inside a Postgres database. This module provides an easy Puppet DSL to for example:
- Create, manage and drop Postgres databases (pg_database)
- Manage the parameter setting of a Postgres database (pg_parameter)
- Create, manage and drop Postgres users and roles (pg_role)
- Create, manage and drop Postgres tablespaces (pg_tablespaces)
- Create, update, manage and drop Postgres schema definitions (pg_schema_definition)
- Create, update, manage and drop (configuration) records in a Postgres table. (pg_record)
- Create your own custom facts based on Postgres database content
- An easy way to execute arbitrary SQL scripts with
only_ifinhibitors to facilitate idempotence. (pg_exec)
All knowledge required to inspect, create, change and remove these Postgres objects is coded into our custom types. For our customers, it means they can focus on the “what” and leave the implementation details to our modules.
Our modules support a broad range of Postgres versions. We are committed to making our modules work on future releases. This allows our customers an easy upgrade path from older to newer versions.