- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with backup
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Changelog/Contributors
Puppet module to install the ruby backup gem and create jobs to back up various services and directories.
The ruby backup gem allows backing up files and various databases and optionally compressing, encrypting, and splitting them into smaller chunks, and copying them to remote systems or file storage service.
This module will install the backup gem, but more powerfully allows the creation and scheduling of jobs based on the backup DSL.
A script is provided in the scripts directory to create a standalone RPM with fpm which includes a global binary to run jobs.
- backup ruby gem
- backup config files
- backup job cron entries
Dependencies to build ruby gems (and backup and it's dependencies specifically) need to be installed for this module. It can optinally install all needed dependencies from a base system.
To install backup:
puppet module install evenup-backups
To install the backup gem:
class { 'backup': }
Creating a backup job to archive /etc to the local path /backups:
backup::job { 'etc':
types => 'archive',
add => '/etc',
storage_type => 'local',
path => '/backups',
}
Create a backup job to archive a riak database and its config, compressing, splitting into 1G chunks, and copying to S3 on Sundays at 01:10:
backup::job { 'riak':
types => ['archive', 'riak'],
add => '/etc/riak',
cookie => 'supersecret',
storage_type => 's3',
compressor => 'bzip2'
level => 9,
split_into => 1024,
aws_access_key => 'AWS_ACCESS_KEY',
aws_secret_key => 'AWS_SECRET_KEY',
bucket => 'backup-bucket',
weekday => 0,
hour => 1,
minute => 10,
}
String. Whether or not the backup gem should be installed.
Default: latest
String. Name of the package to be installed
Default: backup
String. Package provider to install the gem
Default: gem
Boolean. Whether or not development dependenceis for building the backup gem should be installed.
Default: true
String/Array of Strings. List of packages to install as development dependencies.
Boolean. Whether or not unmanaged backup jobs should be purged.
Default: true
Creates backup jobs.
String/Array of Strings. List of backup types to include in this job.
String. A description to use for this backup job.
Cron syntax. Hour the backup job should be scheduled
Default: 23
Cron syntax. Minute the backup job should be scheduled
Default: 5
Cron syntax. Day of the month the backup job should be scheduled
Default: *
Cron syntax. Month the backup job should be scheduled
Default: *
Cron syntax. Day of the week the backup job should be scheduled
Default: *
String. Whether or not the job should be present
Default: present
#####utilities
Hash. Commands and paths provided as key:value pairs to the location of utility commands if not available in the default path
#####tmp_path
String. Set the tmp-path for a backup job run
Default: ~/Backup/.tmp
String/Array of Strings. Used with the archive backup type, list of paths to be included for backup
String/Array of Strings. Used with the archive backup type, list of paths to be excluded for backup
String. Used with multiple database types, database name to back up
String. Hostname to back up
Default: localhost
String. Username to connect to the database as
String. Password for username
to use to connect to the database
Integer. Port to use to connect to the database
String/Array of Strings. MongoDB collections to back up
Boolean. Whether to enable MongoDB lock when backing up
Default: undef (false)
String. Used with Riak backups, node name to back up.
Default: riak@${::fqdn}
String. Cookie to be used for riak backups
Default: riak
#####rdb_path
String. Path to the redis database
Default: /var/lib/redis/dump.rdb
String. Type of storage to use for the backup archive
String. Number of backups to keep on storage
Integer. Size (MB) to split individual backup archives into
String. Path for destination archive
String. AWS access key when using S3 storage type
String. AWS secret key when using S3 storage type
String. Bucket to store archive when using S3 storage type
String. Region to store archive when using S3 storage type
String. Encryptor to use on backup archive
String. Password for archive when using OpenSSL encryptor
String. Compressor to use on backup archive
String. Compression level to use with compressor
Boolean. Enable email notifications
Default: false
Boolean. If email enabled, should successful backups generate an email
Default: false
Boolean. If email enabled, should backups exiting with warnings generate an email
Default: true
Boolean. If email enabled, should backups exiting with errors generate an email
Default: true
String. Email address backup job emails should be sent from
String. Email address backup job emails should be sent to
String. Host backup job notifications should be relayed off of
Default: localhost
Integer. Port on relayhost
emails should be sent to
Default: 25
Boolean. Whether backup job noticies should be sent to HipChat
Default: false
Boolean. If HipChat notifications are enabled, should successful backups be posted
Default: false
Boolean. If HipChat notifications are enabled, should backup jobs exiting with warning be posted
Default: true
Boolean. If HipChat notifications are enabled, should backup jobs exiting with an error be posted
Default: true
String. HipChat API token
String. Name backup job alerts should be posted as
Default: Backup
Array of Strings. HipChat rooms that should be notified about backup jobs
- backup::config: Global configuration
- backup::install: Installs packages
- backup::params: Default parameters
- Requires ruby >= 1.9.3
Improvements and bug fixes are greatly appreciated. See the contributing guide for information on adding and validating tests for PRs.