Deploy restic - fast, secure, efficient backup program.
- Ansible > 2.2
- bzip2 installed on deployer machine (same one where ansible is installed)
All variables which can be overridden are stored in defaults/main.yml file as well as in table below.
Name | Default Value | Description |
---|---|---|
restic_version |
0.8.3 | restic package version. Also accepts latest as parameter. |
restic_user |
"root" | system user to run restic |
restic_group |
"root" | system group to run restic |
restic_install_path |
"/usr/local/bin" | directory where restic binary will be installed |
restic_use_password_file |
"false" | defines if restic will use password file intead of environment variable |
restic_password_dest |
"/root/.restic" | directory where restic password file will be created |
restic_repos |
[] | restic repositories and cron jobs configuration. More in defaults/main.yml |
To ensure high security this role can allow restic to be run as different user than root and still allowing read-only access to files. This is implemented by following PR#1483 from restic repository.
Use it in a playbook as follows:
- hosts: all
become: yes
roles:
- paulfantom.restic
The preferred way of locally testing the role is to use Docker and molecule (v2.x). You will have to install Docker on your system. See Get started for a Docker package suitable to for your system. All packages you need to can be specified in one line:
pip install ansible 'ansible-lint>=3.4.15' 'molecule>2.13.0' docker 'testinfra>=1.7.0' jmespath
This should be similar to one listed in .travis.yml
file in install
section.
After installing test suit you can run test by running
molecule test --all
For more information about molecule go to their docs.
Combining molecule and travis CI allows to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows to create test scenarios for different role configurations. As a result test matrix is quite large and takes more time than local testing, so please be patient.
This project is licensed under MIT License. See LICENSE for more details.