No description
  • Jinja 50.5%
  • Python 49.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Adrien Waksberg 3ccff13ec9
Some checks failed
/ lint (push) Failing after 9s
/ molecule (push) Successful in 2m44s
first version
2026-08-27 22:22:23 +02:00
.forgejo/workflows first version 2026-08-27 22:22:23 +02:00
defaults first version 2026-08-27 22:22:23 +02:00
meta first version 2026-08-27 22:22:23 +02:00
molecule/default first version 2026-08-27 22:22:23 +02:00
tasks first version 2026-08-27 22:22:23 +02:00
templates first version 2026-08-27 22:22:23 +02:00
.gitignore first version 2026-08-27 22:22:23 +02:00
.yamllint first version 2026-08-27 22:22:23 +02:00
CHANGELOG.md first version 2026-08-27 22:22:23 +02:00
LICENSE first version 2026-08-27 22:22:23 +02:00
README.md first version 2026-08-27 22:22:23 +02:00

Ansible role: Barman

Version License Build

Install and configure Barman

Requirements

  • Ansible >= 2.21
  • Debian
    • Trixie

Role variables

Name Type Required Default Comment
barman_postgresql_versions array no [18] the major postgresql version to use
barman_config dict no the general configuration
barman_backups dict no backup configuration
barman_ssh_key_private str no the private ssh key for barman user
barman_authorized_key array no list the ssh public key allowed to connect barman
barman_cron array no set the cron for barman backup

barman_config

See all options on barman documentation

Example:

barman_user: barman
barman_home: /var/lib/barman
log_file: /var/log/barman/barman.log
log_level: INFO

barman_backups

Name Type Required Default Comment
key str yes the backup name
database dict no database connection information for postgresql password file
config dict yes the backup config

Example:

pgtest:
  database:
    name: "postgres"
    hostname: "192.168.1.10"
    port: "5432"
    username: "barman"
    password: "secret"
  config:
    conninfo: host=localhost user=barman dbname=postgres password=secret
    streaming_conninfo: host=localhost user=barman dbname=postgres password=secret
    slot_name: barman
    backup_method: postgres
    streaming_archiver: "on"
    backup_options: concurrent_backup

barman_backups.database

Name Type Required Default Comment
name str no postgres the database name
hostname str yes the database hostname
port int no 5432 the database port
username str no barman the database username
password str yes the database password

Example:

name: "postgres"
hostname: "192.168.1.10"
port: "5432"
username: "barman"
password: "secret"

barman_backups.config

See all options on barman documentation

conninfo: host=localhost user=barman dbname=postgres password=secret
streaming_conninfo: host=localhost user=barman dbname=postgres password=secret
slot_name: barman
backup_method: postgres
streaming_archiver: "on"
backup_options: concurrent_backup

How to use

- hosts: server
  roles:
    - barman
  vars:
    barman_backups:
      pgtest:
        conninfo: host=localhost user=barman dbname=postgres password=secret
        streaming_conninfo: host=localhost user=barman dbname=postgres password=secret
        slot_name: barman
        backup_method: postgres
        streaming_archiver: "on"
        backup_options: concurrent_backup

Development

Test with molecule and docker

  • install docker
  • install python3 and python3-pip
  • install molecule and dependencies pip3 install molecule molecule-docker docker ansible-lint testinfra yamllint
  • run molecule test

License

Copyright (c) 2026 Adrien Waksberg

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.