Code Monkey home page Code Monkey logo

ansible-role-restic's Introduction

Ansible Role: Restic

CI

An Ansible role that installs restic on Linux & FreeBSD.

Requirements

None.

Role Variables

Available variables are listed below, along with 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 specifies version of the restic binary that should be installed. It's matched against GitHub repository where the releases are announced for downloading.
  • restic_install_path provides path where the restic binary should be available from (/usr/local/bin is exported by default as part of $PATH). It's also the same path that is used by the wrapper script that is doing the actual backup execution where the name is constructed as $restic_install_path/restic-$job_name (more on that later).
  • restic_password_file_path provides path to the folder in which password files for restic repositories should be stored. Each file is constructed as $restic_password_file_path/.restic-@job_name. Those files are hidden (hence . in front of the file) by default and are restricted to the restic_ user and restic_group for read-only access. These, by default, are root, but it can be overriden and any valid/already present user can be used. In such case proper capabilities are going to be ensured for this user.
restic_discard_cron_stdout: false

Defines whether the cronjob output should be directed to /dev/null or not (it will send e-mail on each execution if this is set to false).

restic_prometheus_exporter: true
restic_prometheus_output_path: /var/lib/node_exporter/textfile_collector

It enables very simple Prometheus integration that is going to write three values to the default textfile collector location. Please note that enabling support for this is going to install/require two additional dependencies: jq and moreutils (for sponge).

restic_repos: []

This defines an array of restic jobs. Each defined job will create a separate wrapper script and a password file. Examples can be found in defaults/main.yml.

Dependencies

None.

Example Playbook

- hosts: all
  roles:
     - hadret.restic

Credits

This role builds on the shoulders of donat-b/ansible-restic and paulfantom/ansible-restic. All of the molecule tests and CI configuration are based on work of geerlingguy. A lot of parts for the Prometheus integration had been taken directly from this Restic forum thread.

License

MIT

Author Information

This role was somewhat assembled in 2018 by Filip Chabik.

ansible-role-restic's People

Contributors

asosso avatar hadret 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.