Files
Pavel Guzaev 431b4f5cfd all demo
2024-03-09 17:36:50 +05:00
..
2024-03-09 17:36:50 +05:00
2024-03-09 17:36:50 +05:00

Ansible Database Backup

Use community.postgresql.postgresql_db

Backup database from remote postgresql for {{store}} days.

Install

ansible-galaxy collection install community.postgresql

How to dump

ansible-playbook sd_pro_dump.yml -l sd-pgsql9 --extra-vars "dbname=sd4_itsmcorp_devel store=7 arg=--format=custom"
Avalable env:
store: default('1') - how long do you need to store current backup
target: default('/opt/back/internal/postgres/') - where place put the archive
arg: default('--exclude-table=tbl_event --format=custom') - pg_dump argument

PostgreSQL

Official documentaiton.

Example:

pg_dump --format "custom" --file "/opt/back/internal/postgres/{{ dbname }}.bak" {{ dbname }}

Supported Databases

For now supports:

  • PostgreSQL

Supported OS

Linux