hadret.restic
Ansible Role: Restic
This Ansible role installs restic on Linux and FreeBSD.
Requirements
No special requirements needed.
Role Variables
Here are the available variables and their default values (see defaults/main.yml):
restic_version: '0.15.1'
restic_install_path: '/usr/local/bin'
restic_password_file_path: '/root'
restic_discard_cron_stdout: false
restic_user: root
restic_group: "{{ restic_user }}"
restic_version
: This is the version of the restic software that will be installed. It is matched to the releases available on GitHub.restic_install_path
: This is the directory where the restic software will be installed. The default path is/usr/local/bin
, which is included in the system’s path.restic_password_file_path
: This is the folder where password files for your restic backups will be stored. Each password file is named as$restic_password_file_path/.restic-@job_name
and is hidden from normal view (noted by the dot before the filename). Default access is set to therestic_user
andrestic_group
(default isroot
), but you can change it to another user if needed.
restic_discard_cron_stdout: false
This setting controls whether to hide the output of a backup job run by cron. If set to false
, it will send an email after every execution.
restic_prometheus_exporter: true
restic_prometheus_output_path: /var/lib/node_exporter/textfile_collector
This enables a simple integration with Prometheus, which allows for easy monitoring by writing specific data to a preset location. Note that you will need to install additional tools: jq
and moreutils
(for sponge
).
restic_repos: []
This is a list for defining multiple restic backup jobs. Each job will have its own script and password file. Examples are available in defaults/main.yml.
Dependencies
No additional dependencies.
Example Playbook
- hosts: all
roles:
- hadret.restic
Credits
This role builds on previous work from donat-b/ansible-restic and paulfantom/ansible-restic. The tests and continuous integration setup were inspired by geerlingguy. Some parts of the Prometheus setup are based on discussions in this Restic forum thread.
License
MIT
Author Information
This role was put together in 2018 by Filip Chabik.
Restic installation for Linux & FreeBSD.
ansible-galaxy install hadret.restic