Giter Club home page Giter Club logo

alphagov.puppet-duplicity's Introduction

Puppet Duplicity

Build Status

Install duplicity and quickly setup backup to amazon s3, cloud files or local (file).

Basic Usage

node 'kellerautomat' {

  duplicity { 'a_backup':
    directory => '/home/soenke/',
    bucket => 'test-backup-soenke',
    dest_id => 'someid',
    dest_key => 'somekey'
  }
}

Preparing Backup

To prepare files for backup, you can use the pre_command parameter. For example: do a mysqldump before running duplicity.

duplicity { 'my_database':
  pre_command => 'mysqldump my_database > /my_backupdir/my_database.sql',
  directory => '/my_backupdir',
  bucket => 'test-backup',
  dest_id => 'someid',
  dest_key => 'somekey',
}

Removing Old Backups

To remove old backups after a successful backup, you can use the remove_all_but_n_full parameter. For example: Remove backups older than the last 6 full ones:

duplicity { 'my_backup':
  directory => '/root/db-backup',
  bucket => 'test-backup',
  dest_id => 'someid',
  dest_key => 'somekey',
  remove_all_but_n_full => 6,
}

Global Parameters

Access ID and Key, Crypt-Pubkey and bucket name will be global in most cases. To avoid copy-and-paste you can pass the global defaults once to duplicity::params before you include the duplicity class somewhere.

Example:

class defaults {
  class { 'duplicity::params' :
    bucket => 'test-backup-soenke',
    dest_id => 'someid',
    dest_key => 'somekey',
    remove_all_but_n_full => 6,
  }
}

node 'kellerautomat' {

  include defaults

  duplicity { 'blubbi' :
    directory => '/home/soenke/projects/test-puppet',
  }
}

Crypted Backups

In order to save crypted backups this module is able to make use of pubkey encryption. This means you specify a pubkey and restores are only possible with the correspondending private key. This ensures no secret credentials fly around on the machines. Incremental backups work as long as the metadata cache on the node is up to date. Duplicity will force a full backup otherwise because it cannot decrypt anything it downloads from the bucket.

Check https://answers.launchpad.net/duplicity/+question/107216 for more information.

Install duplicity without a backup job

If you want to only install the packages, include duplicity:packages

Restore

Nobody wants backup, everybode wants restore.

alphagov.puppet-duplicity's People

Contributors

ajlanghorn avatar alexmuller avatar bonko avatar dcarley avatar deanwilson avatar dsingleton avatar evilstreak avatar gaudenz avatar jonauman avatar mattbostock avatar mattmcmanus avatar nathan-gs avatar olemchls avatar rjw1 avatar s0enke avatar sorenisanerd avatar surminus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.