GithubHelp home page GithubHelp logo

ansible-role-duplicacy's Introduction

Ansible Role Duplicacy

install and configure duplicacy

The role installs duplicacy and three scripts for duplicacy init, duplicacy backup and duplicacy prune. The pre and post scripts by default are placed in the duplicacy working directory at .duplicacy/scripts to be used by the builtin mechanism from duplicacy for pre and post commands. They can be placed in duplicacy_scriptfile_path and then will be executed by the duplicacy backup or duplicacy prune script.

The output of duplicacy backup is placed in backup.log and the output of duplicacy prune in prune.log in the working directory of duplicacy.

Supported storage backends are defined in duplicacy_storage_backends:

  • 'Local disk'
  • 'Blackblaze B2'
  • 'SSH/SFTP Password'
  • 'SSH/SFTP Keyfile'
  • 'Onedrive'

Role Variables

group variable default description
install duplicacy_version 2.7.2 the duplicacy version to install
install duplicacy_path /opt/duplicacy the path to install duplicacy
install duplicacy_scriptfile_path "{{ duplicacy_path }}/scripts" the path where the scripts for duplicacy init, duplicacy backup, duplicacy restore and duplicacy prune are created
configure duplicacy_snapshot_id the <snapshot id> for duplicacy init
configure duplicacy_working_directory the working directory for duplicacy which is the default path for the repository to backup
configure duplicacy_password the value for DUPLICACY_PASSWORD, e.g. the passphrase to encrypt the backups with before they are stored remotely
configure duplicacy_storage_url the <storage url> for ´duplicacy init`, e.g. the Duplicacy URI of where to store the backups
configure duplicacy_storage_backend the storage backend, possible values are
  1. Local disk
  2. Backblaze B2
  3. SSH/SFTP Password
  4. SSH/SFTP Keyfile
  5. Onedrive
configure duplicacy_repository "{{ duplicacy_working_directory }}" the <path> for duplicacy init -repository <path>
configure duplicacy_secret_file_path "{{ duplicacy_path }}/secret" the path where the token and the ssh-key files are created
configure _duplicacy_secret_file_name ATTENTION: internal variable! The value depends on duplicacy_autobackup_storage_backend the filename for the secret file, the default is
  1. Local disk
    irrelevant
  2. Backblaze B2
    irrelevant
  3. SSH/SFTP Password
    irrelevant
  4. SSH/SFTP Keyfile
    "{{ duplicacy_ssh_key_file_name }}"
  5. Onedrive
    {{ duplicacy_onedrive_token_file_name }}
configure duplicacy_secret_file_content the content for _duplicacy_secret_file_name
configure duplicacy_secret_file_force false if the templating of the secret file will be forced, even if the secret file exists
configure duplicacy_onedrive_token_file_name one-token.json the filename for DUPLICACY_ONE_TOKEN
configure duplicacy_ssh_key_file_name id the filename for DUPLICACY_SSH_KEY_FILE
configure duplicacy_b2_id the value for DUPLICACY_B2_ID
configure duplicacy_b2_key the value for DUPLICACY_B2_KEY
init duplicacy_init_options '-encrypt' the options for duplicacy init
init duplicacy_init_script_file "{{ duplicacy_script_file_path }}/init" the duplicacy init script file
backup duplicacy_backup_immediately false if a backup should be performed immediately after the container is started immediately
backup duplicacy_backup_script_file "{{ duplicacy_script_file_path }}/backup" the duplicacy backup script file
backup duplicacy_pre_backup_script_file_name 'pre-backup' the file name of the pre backup script
backup duplicacy_pre_backup_script_file "{{ duplicacy_working_directory }}/.duplicacy/scripts/{{ duplicacy_pre_backup_script_file_name }}" the pre backup script file
backup duplicacy_post_backup_script_file_name 'post-backup' the file name of the post backup script
backup duplicacy_post_backup_script_file "{{ duplicacy_working_directory }}/.duplicacy/scripts/{{ duplicacy_post_backup_script_file_name }}" the post backup script file
backup duplicacy_pre_backup_script_file_content the content for the pre backup script
backup duplicacy_post_backup_script_file_content the content for the post backup script
backup duplicacy_backup_schedule_user root the cron schedule user for duplicacy backups
backup duplicacy_backup_schedule_hour 1 the cron schedule hour for duplicacy backups
backup duplicacy_backup_schedule_minute 0 the cron schedule minute for duplicacy backups
backup duplicacy_backup_schedule_day * the cron schedule day for duplicacy backups
backup duplicacy_backup_schedule_weekday * the cron schedule weekday for duplicacy backups
backup duplicacy_backup_schedule_month * the cron schedule month for duplicacy backups
prune duplicacy_prune_script_file "{{ duplicacy_script_file_path }}/prune" the duplicacy prune script file
prune duplicacy_pre_prune_script_file_name 'pre-prune' the file name of the pre prune script
prune duplicacy_pre_prune_script_file "{{ duplicacy_working_directory }}/.duplicacy/scripts/{{ duplicacy_pre_prune_script_file_name }}" the pre prune script file
prune duplicacy_post_prune_script_file_name 'post-prune' the file name of the post backup script
prune duplicacy_post_prune_script_file "{{ duplicacy_working_directory }}/.duplicacy/scripts/{{ duplicacy_post_backup_script_file_name }}" the post backup script file
prune duplicacy_pre_prune_script_file_content the content for the pre prune script
prune duplicacy_post_prune_script_file_content the content for the post prune script
prune duplicacy_prune_options -keep 365:3650 -keep 30:365 -keep 7:30 -keep 1:7 -a the options for duplicacy prune
prune duplicacy_prune_schedule_user root the cron schedule user for duplicacy prunes
prune duplicacy_prune_schedule_hour 4 the cron schedule hour for duplicacy prunes
prune duplicacy_prune_schedule_minute 0 the cron schedule minute for duplicacy prunes
prune duplicacy_prune_schedule_day * the cron schedule day for duplicacy prunes
prune duplicacy_prune_schedule_weekday * the cron schedule weekday for duplicacy prunes
prune duplicacy_prune_schedule_month * the cron schedule month for duplicacy prunes
restore duplicacy_restore_options '-overwrite' the options for duplicacy restore
restore duplicacy_restore_script_file "{{ duplicacy_script_file_path }}/restore" the duplicacy restore script file

Test

This role can be tested by

ansible-playbook test/playbook.yml -e "test_backend='Not implemented'"
ansible-playbook test/playbook.yml -e "test_backend='Local disk'"
ansible-playbook test/playbook.yml -e "test_backend='Blackblaze B2'" -e@test/.blackblaze_b2.yml
ansible-playbook test/playbook.yml -e "test_backend='SSH/SFTP Password'" -e@test/.ssh_sftp_password.yml
ansible-playbook test/playbook.yml -e "test_backend='SSH/SFTP Keyfile'" -e@test/.ssh_sftp_key.yml
ansible-playbook test/playbook.yml -e "test_backend='Onedrive'" -e@test/.onedrive.yml

The files test/.<storage>.yml should contain and set the variables of test/<storage>.yml.

ansible-role-duplicacy's People

Contributors

l-with avatar

Stargazers

 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.