{"id":21400244,"url":"https://github.com/oefenweb/ansible-duply-backup","last_synced_at":"2025-07-13T21:31:11.608Z","repository":{"id":31336365,"uuid":"34899008","full_name":"Oefenweb/ansible-duply-backup","owner":"Oefenweb","description":"Ansible role to set up backups using duply in Debian-like systems","archived":false,"fork":false,"pushed_at":"2024-03-11T10:22:15.000Z","size":133,"stargazers_count":15,"open_issues_count":4,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-03-11T11:36:39.517Z","etag":null,"topics":["ansible","backup","debian","duplicity","duply-backup","ubuntu"],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oefenweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-05-01T10:52:54.000Z","updated_at":"2023-05-16T00:04:44.000Z","dependencies_parsed_at":"2023-01-14T18:49:45.893Z","dependency_job_id":"5604e781-9825-4549-8b41-b01586e7cca1","html_url":"https://github.com/Oefenweb/ansible-duply-backup","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-duply-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-duply-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-duply-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-duply-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oefenweb","download_url":"https://codeload.github.com/Oefenweb/ansible-duply-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225917604,"owners_count":17544923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","backup","debian","duplicity","duply-backup","ubuntu"],"created_at":"2024-11-22T15:20:06.770Z","updated_at":"2024-11-22T15:20:07.526Z","avatar_url":"https://github.com/Oefenweb.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"## duply-backup\n\n[![CI](https://github.com/Oefenweb/ansible-duply-backup/workflows/CI/badge.svg)](https://github.com/Oefenweb/ansible-duply-backup/actions?query=workflow%3ACI)\n[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-duply--backup-blue.svg)](https://galaxy.ansible.com/Oefenweb/duply_backup)\n\nSet up [duplicity](http://duplicity.nongnu.org/) backups using [duply](http://duply.net/) in Debian-like systems.\n\n#### Requirements\n\nNone\n\n#### Variables\n\n* `duply_backup_profiles`: [default: `{}`]: Duply backup profiles\n* `duply_backup_profiles.key`: The name of the profile (e.g. `etc`)\n* `duply_backup_profiles.key.conf`: Conf declarations\n* `duply_backup_profiles.key.conf.gpg_key`: Encrypt with key (**optional**, omitting will disable encryption)\n* `duply_backup_profiles.key.conf.gpg_pw`: Symmetric encryption using passphrase only (**optional**)\n* `duply_backup_profiles.key.conf.gpg_keys_enc`: Public key to encrypt to (**optional**)\n* `duply_backup_profiles.key.conf.gpg_key_sign`: A secret key for signing (**optional**)\n* `duply_backup_profiles.key.conf.gpg_pw_sign`: Signing key passphrase (**optional**)\n* `duply_backup_profiles.key.conf.gpg`: Override the used gpg executable, defaults to `gpg` (**optional**)\n* `duply_backup_profiles.key.conf.gpg_opts`: GPG options passed from duplicity to gpg process (**optional**)\n* `duply_backup_profiles.key.conf.gpg_test`: Disable preliminary tests (**optional**, set to `false` to disable)\n* `duply_backup_profiles.key.conf.gpg_import`: Disable automatic gpg key importing altogether\n* `duply_backup_profiles.key.conf.gpg_export`: Disable automatic gpg key exporting to profile folder\n* `duply_backup_profiles.key.conf.target`: Location of the backup target, [see duplicity manpage](http://duplicity.nongnu.org/duplicity.1.html#sect7)\n* `duply_backup_profiles.key.conf.target_user`: Username of the backup target (**optional**)\n* `duply_backup_profiles.key.conf.target_pass`: Password of the backup target (**optional**)\n* `duply_backup_profiles.key.conf.export`: Environment variables to set (**optional**)\n* `duply_backup_profiles.key.conf.export.{n}.name`: Name of the variable (e.g. `AWS_ACCESS_KEY_ID`)\n* `duply_backup_profiles.key.conf.export.{n}.value`: Value of the variable (e.g. `26E1A49CFE81D46C83C2`)\n* `duply_backup_profiles.key.conf.source`: Base directory to back up\n* `duply_backup_profiles.key.conf.dupl_precmd`: A command that runs duplicity (**optional**)\n* `duply_backup_profiles.key.conf.python`: Override the used python interpreter, defaults to `python` (**optional**)\n* `duply_backup_profiles.key.conf.exclude_if_present`: Exclude if present file name (**optional**)\n* `duply_backup_profiles.key.conf.max_age`: Time frame for old backups to keep (**optional**)\n* `duply_backup_profiles.key.conf.max_full_backups`: Number of full backups to keep (**optional**)\n* `duply_backup_profiles.key.conf.max_fulls_with_incrs`: Number of full backups for which incrementals will be kept for (**optional**)\n* `duply_backup_profiles.key.conf.max_fullbkp_age`: Forces a full backup if last full backup reaches a specified age (**optional**)\n* `duply_backup_profiles.key.conf.volsize`: Sets the size of backup chunks (**optional**, in MB's)\n* `duply_backup_profiles.key.conf.verbosity`: Verbosity of output (**optional**)\n* `duply_backup_profiles.key.conf.temp_dir`: Temporary file space. At least the size of the biggest file in backup for a successful restoration process (**optional**)\n* `duply_backup_profiles.key.conf.arch_dir`: Defines a folder that holds unencrypted metadata of the backup, enabling new incrementals without the need to decrypt backend metadata first (**optional**)\n* `duply_backup_profiles.key.conf.time_separator`: Enables duplicity `--time-separator` option (**optional**, **deprecated**, set to `true` to enable)\n* `duply_backup_profiles.key.conf.short_filenames`: Enables duplicity `--short-filenames` option (**optional**, **deprecated**, set to `true` to enable)\n* `duply_backup_profiles.key.conf.dupl_params`: Additional duplicity command line options. Don't forget to leave a separating space char at the end (**optional**)\n* `duply_backup_profiles.key.pre`: Pre script (**optional**)\n* `duply_backup_profiles.key.post`: Post script (**optional**)\n* `duply_backup_profiles.key.excludes`: A list of glob patterns of included or excluded files / folders (**optional**)\n\n* `duply_backup_gpg_pub_keys`: [default: `[]`]: Public keys to import\n* `duply_backup_gpg_ownertrusts`: [default: `[]`]: Owner trusts to import\n* `duply_backup_gpg_sec_keys`: [default: `[]`]: Private keys to import\n\n* `duply_backup_jobs`: [default: `[]`]: Duply backup jobs (scheduled by `cron.d`)\n* `duply_backup_jobs.{n}.name`: [required]: Description of a crontab entry, should be unique, and changing the value will result in a new cron task being created (e.g. `duply-backup-etc`)\n* `duply_backup_jobs.{n}.job`: [required]: The command to execute (e.g. `/usr/local/bin/duply etc backup`)\n* `duply_backup_jobs.{n}.state`: [default: `present`]: Whether to ensure the job is present or absent\n* `duply_backup_jobs.{n}.day`: [default: `*`]: Day of the month the job should run (`1-31`, `*`, `*/2`)\n* `duply_backup_jobs.{n}.hour`: [default: `*`]: Hour when the job should run (e.g. `0-23`, `*`, `*/2`)\n* `duply_backup_jobs.{n}.minute`: [default: `*`]: Minute when the job should run (e.g. `0-59`, `*`, `*/2`)\n* `duply_backup_jobs.{n}.month`: [default: `*`]: Month of the year the job should run (e.g `1-12`, `*`, `*/2`)\n* `duply_backup_jobs.{n}.weekday`: [default: `*`]: Day of the week that the job should run (e.g. `0-6` for Sunday-Saturday, `*`)\n\n## Dependencies\n\nNone\n\n## Recommended\n\n* `ansible-duplicity` ([see](https://github.com/Oefenweb/ansible-duplicity), to get the latest version of `duplicity`)\n* `ansible-duply` ([see](https://github.com/Oefenweb/ansible-duply), to get the latest version of `duply`)\n\n#### Example(s)\n\n##### Simple configuration (GPG disabled)\n\n```yaml\n---\n- hosts: all\n  roles:\n  - oefenweb.duply-backup\n  vars:\n    duply_backup_profiles:\n      etc:\n        conf:\n          target: 'file:///tmp/duply-backup/target'\n          source: '/etc'\n        excludes:\n          - '+ /etc/skel'\n          - '- **'\n```\n\n##### Advance configuration (GPG enabled)\n\nOn your Ansible control machine machine in `../../../files/duply-backup/`.\n\n###### Generate a GPG key pair\n```sh\ngpg --batch --gen-key \u003c\u003cEOF\n\u003e %echo Generating a GPG key\n\u003e Key-Type: RSA\n\u003e Key-Length: 4096\n\u003e Subkey-Type: RSA\n\u003e Subkey-Length: 4096\n\u003e Name-Real: Duplicity Backup\n\u003e Name-Comment: localhost.localdomain\n\u003e Name-Email: root@localhost.localdomain\n\u003e Expire-Date: 0\n\u003e Passphrase: QUsNMnD6GHUTFSBruSwbJpZBhto=\n\u003e %commit\n\u003e %echo Done\n\u003e EOF\ngpg: Generating a GPG key\n.....+++++\n........+++++\n.....+++++\n.........................+++++\ngpg: key E6564C6E marked as ultimately trusted\ngpg: Done\n```\n\n###### Export the public key\n```sh\ngpg --output E6564C6E.pub.asc --armor --export E6564C6E;\n```\n\n###### Export the ownertrust (value 6, ultimately trusted)\n```sh\necho \"$(gpg --with-fingerprint E6564C6E.pub.asc | grep fingerprint | tr -d '[:space:]' | awk 'BEGIN { FS = \"=\" } ; { print $2 }'):6:\" 1\u003e E6564C6E.ownertrust.txt;\n```\n\n###### Export the private key\n```sh\ngpg --output E6564C6E.sec.asc --armor --export-secret-key E6564C6E;\n```\n\n```yaml\n---\n- hosts: all\n  roles:\n  - oefenweb.duply-backup\n  vars:\n    duply_backup_profiles:\n      etc:\n        conf:\n          gpg_key: 'E6564C6E'\n          gpg_pw: 'QUsNMnD6GHUTFSBruSwbJpZBhto='\n          gpg_key_sign: 'E6564C6E'\n          gpg_pw_sign: 'QUsNMnD6GHUTFSBruSwbJpZBhto='\n          gpg_opts: '--pinentry-mode loopback'\n\n          target: 'file:///data/backup/etc'\n          source: '/etc'\n\n          max_age: 1W\n          max_fullbkp_age: 1M\n\n          verbosity: 5\n\n          arch_dir: '/data/backup/.duply-cache'\n        pre: ../../../files/duply-backup/pre\n        post: ../../../files/duply-backup/post\n        excludes:\n          - '+ /etc/skel'\n          - '- **'\n\n    duply_backup_gpg_pub_keys:\n      - ../../../files/duply-backup/E6564C6E.pub.asc\n    duply_backup_gpg_ownertrusts:\n      - ../../../files/duply-backup/E6564C6E.ownertrust.txt\n    duply_backup_gpg_sec_keys:\n      - ../../../files/duply-backup/E6564C6E.sec.asc\n    duply_backup_jobs:\n      - name: duply-backup-etc\n        job: /usr/local/bin/duply etc backup\n        minute: \"0\"\n```\n\n#### License\n\nMIT\n\n#### Author Information\n\nMischa ter Smitten\n\n#### Feedback, bug-reports, requests, ...\n\nAre [welcome](https://github.com/Oefenweb/ansible-duply-backup/issues)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foefenweb%2Fansible-duply-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foefenweb%2Fansible-duply-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foefenweb%2Fansible-duply-backup/lists"}