An Ansible playbook to automate installation/upgrade/configuration of postgresql.
- Tweaks some sysctl.conf values for performance.
- Adds cronjob to perform daily backup for all databases.
- Support Debian OS for now.
The following variables are supported:
- backup_dir: control where to store the database backup files (default: '/data/backups')
- backup_maxage: max age in days of database backups before we start deleting old ones (default to '7')
- cron_run_hour: at which hour cron should run (default 21)
- cron_run_minute: at which minute cron should run (default also 21)
- Clone this repository, edit hosts
- For fresh install run: ansible-playbook -i hosts pg_play.yaml
- To upgrade postgresql run (maybe weekly as cronjob): ansible-playbook -i hosts pg_upgrade.yaml