Coder Social home page Coder Social logo

vorlon / puppet-duplicity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tohuwabohu/puppet-duplicity

0.0 1.0 0.0 169 KB

Puppet module to manage backups based on duplicity.

License: Apache License 2.0

Ruby 44.86% Puppet 42.52% HTML 12.62%

puppet-duplicity's Introduction

#duplicity

##Overview

Configure duply on top of duplicity to provide a profile-based, easy to use backup and restore system.

##Usage

Install duplicity and duply with all default values.

class { 'duplicity':
  ensure => present,
}

Install a more recent version of duply from the sourceforge project page

class { 'duplicity':
  duply_package_provider => 'archive',
  duply_archive_version  => '1.9.1',
  duply_archive_md5sum   => 'd584940b9c740c81a2a081bc154084b9',
}

Specify the backup server to be used; see the duplicity documentation for more information about the available protocols.

class { 'duplicity':
  backup_target_url      => 'ftps://backup.example.com/',
  backup_target_username => 'username',
  backup_target_password => 'password',
}

Configure a simple backup profile. It will run once a day, do incremental backups by default and create a full backup if the previous full backup is older than 7 days. Duplicity will keep at most two full backups and purge older ones.

duplicity::profile { 'system':
  full_if_older_than => '7D',
  max_full_backups   => 2,
  cron_hour          => '4',
  cron_minute        => '0',
}

Backup a file and restore it from a previous backup if it is not existing. Setting ensure to backup will only backup the file but not restore it.

Note: a directory will only be restored if the directory is not existing - an empty directory is not replaced.

duplicity::file { '/path/to/file':
  ensure => present,
}

Backup a directory by using a specific backup profile and exclude a bunch of files.

$data_dir = '/var/lib/jira'

duplicity::file { $data_dir:
  profile => 'jira',
  exclude => [
    "${$data_dir}/caches",
    "${$data_dir}/tmp",
    "${$data_dir}/plugins/.osgi-plugins/felix/felix-cache",
    "${$data_dir}/plugins/.osgi-plugins/transformed-plugins",
  ],
}

Define a GnuPG key pair BEEF1234 to be used to de/encrypt the backup on the node itself and configure the backup profile to use it. The encrytion key ALICE00001 is used to decrypt the backup on another node (e.g. the admin's workstation).

duplicity::private_key { 'BEEF1234':
  content => hiera('duplicity::private_key::BEEF1234'),
}

duplicity::public_key { 'BEEF1234':
  content => template('path/to/BEEF1234.pub.asc.erb'),
}

class { 'duplicity':
  gpg_encryption_keys => ['ALICE00001', 'BEEF1234'],
  gpg_signing_key     => 'BEEF1234',
}

Or turn off the encryption of backups for a particular profile altogether:

duplicity::profile { 'system':
  gpg_encryption => false,
}

##Limitations

The module has been tested on the following operating systems. Testing and patches for other platforms are welcome.

  • Debian 6.0 (Squeeze)
  • Debian 7.0 (Wheezy)
  • Ubuntu 12.04 (Precise Pangolin)
  • Ubuntu 14.04 (Trusty Tahr)
  • RHEL/Centos 6

Build Status

##Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

###Development

This project uses rspec-puppet and beaker to ensure the module works as expected and to prevent regressions.

gem install bundler
bundle install --path vendor

bundle exec rake spec
bundle exec rake beaker

(note: see Beaker - Supported ENV variables for a list of environment variables to control the default behaviour of Beaker)

puppet-duplicity's People

Contributors

adamcrews avatar tohuwabohu avatar vorlon avatar

Watchers

 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.