Skip to content

Install and configure restic + autorestic for automated backups

Notifications You must be signed in to change notification settings

adsanz/ansible-restic-role

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTIC

This role installs and configures restic & auto-restic.

Requirements

No previous requirements are required

Role Variables

There are 3 types of vars:

  • Install vars
  • Config vars
  • Trigger vars

Only install vars are viable on it's default value. To configure restic_locations and backends, just follow yaml guidelines and autorestic docs (https://autorestic.vercel.app/). It should be the same definition (thanks to jinja2 templating in ansible)

Read carefully the deafult variables!

The trigger to launch an "autorestic check" needs the autorestic_generated_conf_path to be defined! This var is used to fetch the generated configuration file with the key to a local path where ansible is being executed. It needs the "autorestic_check" var set to true also.

Some tips!

  • After the first time execution if autorestic check is run, it is a good idea to keep that file, since you can use it in other environment to restore backups
  • Be careful when running this over the same host, there should be not problems, but you may find autorestic.yml being overwritten, to avoid this, the template generated by ansible should match the file on the host. (restic_location and restic_backends should not vary unless you want to)
  • read the doccs on autorestic and restic site to understand how cron / forget policies work.
  • Autorestic or restic does not seems able to make backup of single files, it needs a full folder in order to work properly, take that into account when configuring locations.

Dependencies

No dependencies to other roles

Example Playbook

Just add it to the playbook as restic.role :)

If you want to run tests, the "tests" dir have a vagrant env configured.

License

BSD

Author Information

AdSanz A.K.A Null0ps

About

Install and configure restic + autorestic for automated backups

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages