Forge Home

backuppc

BackupPC module

15,214 downloads

6,214 latest version

5.0 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

  • 2.0.0 (latest)
  • 1.0.0
  • 0.2.0
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.0.1
released Jun 6th 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 6.0.0
  • , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'wyrie-backuppc', '2.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add wyrie-backuppc
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install wyrie-backuppc --version 2.0.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
Tags: backuppc

Documentation

wyrie/backuppc — version 2.0.0 Jun 6th 2018

BackupPC Module

Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - scores

Table of Contents

  1. Overview
  2. Module Description
  3. Usage
  4. Reference

Overview

This module will install and configure a BackupPC server and allow you to add other puppet managed nodes as clients/hosts. It uses exported resources to create the client's configuration file, add it to the hosts file and setup ssh access if needed.

This module started as a fork of https://github.com/codec/puppet-backuppc.

Module Description

BackupPC has many configuration options and this module should provide you access to most of them. BackupPC's global configuration file is managed by backuppc::server and is intended to setup useful defaults that can be overridden by the client if needed.

Where BackupPC's configuration file uses camel case for the config variables the module's class parameters would use the same names but replacing the uppercase characters with lowercase and an underscore prefix.

For xfer methods that require ssh the module can:

  • Create a non-privledged account on the client and allow it access to rsync or tar via sudo.
  • Install the server's ssh key.
  • Add the client's ssh key to the list of known hosts.

By default the account name is 'backup'. You can choose to do the ssh configuration yourself if it doesn't suit your environment (see the client.pp file for notes on system_account).

The module is designed to work alongside the BackupPC web administration interface, meaning hosts that are configured but not managed by this module will still work.

Usage

Minimal server configuration

class { 'backuppc::server':
  backuppc_password => 'somesecret'
}

This will do the typical install, configure and service management. The module does not manage apache. It will, if the apache_configuation parameter is true, install an apache configuration file that creates an alias from the /backuppc url to the backuppc files on the system. Additionally it will create a htpasswd file with the default backuppc user and the password that you provide for access to the web based administration. You will however need to inform the apache service that something has changed. Alternatively you can install backuppc as a virtual host or whatever else suits your needs.

Additional login accounts

backuppc::server::user { 'john':
  password => 'mypassword'
}

The default path to the htpasswd file is in the [config_directory]/htpasswd. You can add additional login accounts and assign these to hosts (see client examples for this).

More server configuration

class { 'backuppc::server':
  backuppc_password => 'somesecret'
  wakeup_schedule   => [1, 2, 3, 4, 5, 21, 22, 23],
  max_backups       => 3,
  max_user_backups  => 1,
}

Please consult the BackupPC documentation for explanations on configuration options: http://backuppc.sourceforge.net/faq/BackupPC.html

Some configuration options, like xfer_method, is more useful to set when adding a client. Where a configuration parameter is ommited backuppc's default is applied in the main/global configuration file.

Client configuration

class { 'backuppc::client':
  backuppc_hostname     => 'fqdn.backuppcserver.com',
  rsync_share_name      => ['/home', '/etc'],
  hosts_file_more_users => 'john',
}

You'll need to specify the hostname of the node on which you installed backuppc server. This value should be the same as the facter value for fqdn. By default the xfer_method is rsync and you can specify the paths to backup with the parameter rsync_share_name. With rsync and tar methods the module will create on the client an system account and allow the server access to it (see the description section in this readme).

Backuping up the backuppc server itself

class { 'backuppc::client':
  backuppc_hostname => $::fqdn,
  xfer_method       => 'tar',
  tar_share_name    => ['/home', '/etc', '/var/log'],
  tar_client_cmd    => '/usr/bin/sudo $tarPath -c -v -f - -C $shareName --totals',
  tar_full_args     => '$fileList',
  tar_incr_arge     => '--newer=$incrDate $fileList',
}

Debian by default installs a 'localhost' host, but if you want to managed it with puppet or if you're on Centos/RHEL this example will use the tar method to backup the paths you sepcify. The example uses sudo which is not configured in the module itself.

Reference

Classes

Public Classes

  • backuppc:server: Class used to install backuppc.
  • backuppc::client: Configures host for backup through backuppc.

Private Classes

  • backuppc::params: Default values.