Forge Home

duplicity

Install and manage duplicity

52,061 downloads

167 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

  • 6.7.0 (latest)
  • 6.6.5
  • 6.6.4
  • 6.6.3
  • 6.6.2
  • 6.6.1
  • 6.6.0
  • 6.5.0
  • 6.4.0
  • 6.3.1
  • 6.3.0
  • 6.2.0
  • 6.1.0
  • 6.0.0
  • 5.1.1
  • 5.1.0
  • 5.0.0
  • 4.10.1
  • 4.10.0
  • 4.9.0
  • 4.8.0
  • 4.7.0
  • 4.6.0
  • 4.5.3
  • 4.5.2
  • 4.5.1
  • 4.5.0
  • 4.4.2
  • 4.4.1
  • 4.4.0 (deleted)
  • 4.3.0
  • 4.2.0
  • 4.1.0
  • 4.0.0
  • 3.6.3
  • 3.6.2
  • 3.6.1
  • 3.6.0
  • 3.5.2
  • 3.5.1
  • 3.5.0
  • 3.4.0
  • 3.3.0
  • 3.2.0
  • 3.1.1
  • 3.1.0
  • 3.0.1
  • 3.0.0
  • 2.0.0
  • 1.0.0
released Apr 20th 2024
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
  • Puppet >= 5.0.0 < 9.0.0
  • ,

Start using this module

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

Add this module to your Puppetfile:

mod 'tohuwabohu-duplicity', '6.7.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add tohuwabohu-duplicity
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install tohuwabohu-duplicity --version 6.7.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

tohuwabohu/duplicity — version 6.7.0 Apr 20th 2024

duplicity

License build-and-test Puppet Forge Puppet Forge - downloads

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': }

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

class { 'duplicity':
  duply_package_provider      => 'archive',
  duply_archive_version       => '2.1',
  duply_archive_checksum      => 'a8d2bfa907aacbef1c66bf1079fa24e541ad63f5d0694029e4596b030f3cb244',
  duply_archive_checksum_type => 'sha256',
}

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',
}

In case you're using duply 1.10+ and a storage backend that requires additional environment variables to be set, use the following pattern

class { 'duplicity':
  duply_environment => [
    "export AWS_ACCESS_KEY_ID='${my_access_key}'",
    "export AWS_SECRET_ACCESS_KEY='${my_secret_key}'",
  ],
}

This works on a profile-level as well.

Configure a simple backup profile that stops an application before the backup starts and starts it when complete. 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',
  exec_before_content => '/bin/systemctl stop myapp',
  exec_after_content  => '/bin/systemctl start myapp',
}

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.

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

A directory will only be restored if the directory is not existing - an empty directory is not replaced. To prevent Puppet from accidentally creating an empty directory, explicitly add a dependency between the duplicity::file and the file as shown in the following example. This will ensure the restore process will get a chance to run before the directory is created.

duplicity::file { $mailman3_data_dir:
  timeout => 1800,
}

-> file { $mailman3_data_dir:
  ensure => directory,
  owner  => 'list',
  group  => 'list',
  mode   => '0644',
}

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 9.0 (Stretch)
  • Debian 10.0 (Buster)
  • Ubuntu 18.04 (Bionic Beaver)
  • Ubuntu 20.04 (Focal Fossa)

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)