Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
- Puppet >= 4.10.0 < 8.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'deric-pgprobackup', '0.1.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-pgprobackup
Automates PostgreSQL backups using pgprobackup.
Description
Module allows configuration of a PostgreSQL instance (role for backup, SSH keys, hba rules) and a (remote) backup catalog (user account, backup directory, host keys, SSH keys).
Setup
What pgprobackup affects
Module touches many resources, including PostgreSQL configuration that might require server restart (e.g. when archive_mode
is modified). Make sure to understand the implications before using it. Each feature could be turned off in case you're using some other mechanism.
- database configuration
- database roles
- role password
- SSH host keys
- SSH authorized keys (public SSH keys)
- CRON jobs
- user accounts
pgprobackup
catalog
Setup Requirements
- Puppet >= 5
- PostgreSQL instance >= 9.5
puppetlabs/postgresql
is expected to manage the PostgreSQL instance
Usage
Backup server (where backup data will be stored) requires packages for all different PostgreSQL version that are running the same host_group
, e.g. pg_probackup-11
, pg_probackup-12
.
include pgprobackup::catalog
NOTE: Package version catalog
and instance
needs to be exactly the same! (e.g. 2.3.3-1.6a736c2db6402d77
).
pgprobackup::package_ensure
allows pinpointing to a specific version:
pgprobackup::package_ensure: "2.4.2-1.8db55b42aeece064.%{facts.os.distro.codename}"
Instance
DB server:
include pgprobackup::instance
Configure pgprobackup
to run full backup every Sunday (via CRON job):
pgprobackup::manage_cron: true
pgprobackup::instance::backups:
FULL:
hour: 3
minute: 15
weekday: [0] # same as `7` or `Sunday`
Incremental (DELTA
) backups every day except Sunday:
pgprobackup::instance::backups:
FULL:
weekday: 0
DELTA:
weekday: [1-6]
Incremental (DELTA
) backups every day except Friday, full backup on Friday:
pgprobackup::instance::backups:
FULL:
weekday: 5
DELTA:
weekday: [0-4,6]
There are many shared parameters between instance
and catalog
. Such parameters are defined in pgprobackup::
namespace, such as pgprobackup::package_name
(base package name to be installed on both instance and catalog).
retention_window
Defines the earliest point in time for which pg_probackup can complete the recovery.retention_redundancy
The number of full backup copies to keep in the backup catalog.delete_expired
Delete expired backups whenretention_redundancy
orretention_window
is set.merge_expired
Merge expired backups whenretention_redundancy
orretention_window
is set.
Limitations
Error message on catalog
server:
Could not find resource 'Package[pg-probackup-11]' in parameter 'require'
means, that the server requires packages for all different Postgresql versions that are being backed up.
pgprobackup::catalog::versions:
- '11'
- '12'
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/apt (>= 2.0.0 < 8.0.0)
- puppetlabs/cron_core (> 1.0.0)
- puppetlabs/postgresql (>=6.3.0 <7.0.0)
- puppetlabs/sshkeys_core (> 1.0.0)
- puppetlabs/stdlib (>= 2.3.3 < 7.0.0)
- puppetlabs/yumrepo_core (>= 1.0.0)