This role is for setting up Barman server. Barman is a backup and recovery tool for Postgres.
Following are the requirements of this role.
- Ansible
edb_devops.edb_postgres
->setup_repo
role for setting the repository on the systems.
When executing the role via ansible these are the required variables:
- pg_version
Postgres Versions supported are: 10, 11, 12, 13, 14 and 15
- pg_type
Database Engine supported are: PG and EPAS
These and other variables can be assigned in the pre_tasks
definition of the
section: How to include the setup_barmanserver
role in your Playbook
The rest of the variables can be configured and are available in the:
Below is the documentation of the rest of the main variables:
System user running barman commands. Default: barman
Example:
barman_user: 'barman'
System group the barman user is part of. Default: barman
Example:
barman_group: 'barman'
Barman main configuration file path. Default: /etc/barman.conf
Example:
barman_configuration_file: '/etc/barman.conf'
Directory containing the included barman configuration files.
Default: /etc/barman.d
Example:
barman_configuration_files_directory: '/etc/barman.d'
Path of the barman home directory. Backup files and archived WAL files are
stored in this root directory. Default: /var/lib/barman
Example:
barman_home: '/var/lib/barman'
Path of the barman execution directory. Default: /var/run/barman
Example:
barman_lock_directory: '/var/run/barman'
Barman logging file path. Default: /var/log/barman/barman.log
Example:
barman_log_file: '/var/log/barman/barman.log'
Logging level. Default: INFO
Example:
barman_log_level: 'INFO'
Compression tool to use for backups and archived WAL files. Default: gzip
Example:
barman_compression: 'gzip'
This role does not have any dependencies, but packages repositories should have
been configured beforehand with the setup_repo
role.
Content of the inventory.yml
file:
---
all:
children:
barmanserver:
hosts:
barman1:
ansible_host: xxx.xxx.xxx.xxx
private_ip: xxx.xxx.xxx.xxx
Below is an example of how to include the setup_barmanserver
role:
---
- hosts: barmanserver
name: Deploy Barman Servers
become: yes
gather_facts: yes
any_errors_fatal: true
collections:
- edb_devops.edb_postgres
pre_tasks:
- name: Initialize the user defined variables
set_fact:
pg_version: 14
pg_type: "PG"
roles:
- role: setup_repo
when: "'setup_repo' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
# Install Postgres binaries required for Barman
- role: install_dbserver
when: "'install_dbserver' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
- role: setup_barmanserver
when: "'setup_barmanserver' in lookup('edb_devops.edb_postgres.supported_roles', wantlist=True)"
Defining and adding variables is done in the set_fact
of the pre_tasks
.
All the variables are available at:
BSD
Author:
- Julien Tachoires
- Vibhor Kumar (Reviewer)
- EDB Postgres
- [email protected] www.enterprisedb.com