Forge Home

9,961 downloads

9,961 latest version

3.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.0 (latest)
released Jan 2nd 2013

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'deviseit-barman', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add deviseit-barman
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install deviseit-barman --version 0.1.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

deviseit/barman — version 0.1.0 Jan 2nd 2013

Barman module for Puppet

Description

This module manages the installation of Barman and the configuration of PostgreSQL servers to be backed up.

For further information on barman:

Installation

The module can be installed automatically with the puppet command on the master, or manually by cloning the repository in your puppet module path.

Installing via puppet

The latest version of the module can be installed automatically by supplying the repository information to the module installer:

# puppet module install deviseit-barman

This will take care of the dependencies as well.

Installing manually

If you choose to install manually, you will have to clone the repository in the module path and handle dependencies manually.

The dependencies that need to be installed are stdlib and apt from puppetlabs.

Usage

barman

The barman class installs barman. Currently only Ubuntu and Debian are supported.

Intensive testing has only been done on Ubuntu 12.04 LTS.

In order to install Barman with the defaults option, it is sufficient to just include the barman class:

class { 'barman': }

All the configuration options that barman accepts can be overridden from the package defaults.

Example usage:

class { barman:
  home     => '/srv/barman',
  logfile  => '/var/log/barman/something_else.log',
  compression => 'bzip2',
  pre_backup_script = '/usr/bin/touch /tmp/started',
  post_backup_script = '/usr/bin/touch /tmp/stopped',
  custom_lines = '; something'
}

Parameters

  • home - A different place for backups than the default. Will be symlinked to the default (/var/lib/barman). You should not change this value after the first setup.
  • logfile - A different log file. Default: /var/log/barman/barman.log
  • compression - Compression algorithm. Currently supports 'gzip' (default), 'bzip2', and 'custom'. Disabled if false.
  • pre_backup_script - Script to launch before backups. Disabled if false (default).
  • post_backup_script - Script to launch after backups. Disabled if false (default).
  • custom_lines - Custom configuration directives (e.g. for custom compression). Defaults to empty.

Facts

The module generates a fact called barman_key which has the content of /var/lib/barman/.ssh/id_rsa.pub, in order to automatically handle the key exchange on the postgres server via puppetdb.

If the file doesn't exist, a key will be generated.

barman::server

The barman::server class configures barman to handle backups for a PostgreSQL server.

The only required parameters are conninfo and ssh_command.

Example:

barman::server { 'main':
  conninfo    => 'user=postgres host=server1 password=pg123',
  ssh_command => 'ssh postgres@server1',
}

Overriding global configuration is supported for most of the parameters.

Example:

barman::server { 'main':
  conninfo    => 'user=postgres host=server1 password=pg123',
  ssh_command => 'ssh postgres@server1',
  compression => 'bzip2',
  pre_backup_script = '/usr/bin/touch /tmp/started',
  post_backup_script = '/usr/bin/touch /tmp/stopped',
  custom_lines = '; something'
}

Parameters

Many of the main configuration parameters can be passed in order to perform overrides.

  • conninfo - Postgres connection string. Mandatory.
  • ssh_command - Command to open an ssh connection to Postgres. Mandatory.
  • compression - Compression algorithm. Uses the global configuration if false (default).
  • pre_backup_script - Script to launch before backups. Uses the global configuration if false (default).
  • post_backup_script - Script to launch after backups. Uses the global configuration if false (default).
  • custom_lines - Custom configuration directives (e.g. for custom compression). Defaults to empty.

License

This module is distributed under GNU GPLv3

Author

This module was developed by Alessandro Grassi for Devise.IT. Special thanks go to the 2ndQuadrant Italia team.