Enter PostgresPlus (EnterpriseDB), this version is available commercially and had no modules in the forge to work with.
In starting this I began with creating a manifest that would install the server which was simple enough. When it came to adding in roles,users and databases I found that it was easiest to just merge in parts of the existing Puppetlabs PostgreSQL module.
Once all of this was done it was time to move onto the replication.
Replication is done through using exported resources. These are similar to virtual resources in that you use @ and spaceships with three major differances.
- The class/function is exported with @@
- The class/function is substantiated with <<| |>>
- Requires a PuppetDB to work
By attaching the master class to the server it will push back an exported resource to the PuppetDB with a tag.
When we add the target class to the target server it will pull out the exported resource from the PuppetDB and apply it on this node, creating the configuration files for replication to start working.
This will also allow for dynamic creation of target nodes with as many as is required, even witht he master in full production.