Coder Social home page Coder Social logo

ansible.role.backup_borg's Introduction

Borg Backup Role

Postgres Ansible role

This is an Ansible role which install and configure borgbackup with borgmatic a Docker container wrapped in a systemd service. BorgBackup is a deduplicating backup program with optional compression and encryption. That means your daily incremental backups can be stored in a fraction of the space and is safe whether you store it at home or on a cloud service.

This role implicitly depends on:

Features

Usage

Example playbook:

- hosts: servers
  roles:
    - role: galaxy/com.devture.ansible.role.systemd_docker_base

    - role: galaxy/ansible.role.backup_borg

    - role: another_role

Example playbook configuration (group_vars/servers or other):

backup_borg_enabled: false

backup_borg_identifier: my-borgbackup

backup_borg_base_path: "{{ my_base_path }}/backup_borg"

backup_borg_username: "{{ my_username }}"
backup_borg_uid: "{{ my_uid }}"
backup_borg_gid: "{{ my_gid }}"


backup_borg_container_image_self_build: "{{ architecture not in ['amd64', 'arm32', 'arm64'] }}"

backup_borg_postgresql_enabled: "{{ devture_postgres_enabled }}"
backup_borg_postgresql_databases_hostname: "{{ devture_postgres_connection_hostname if devture_postgres_enabled else '' }}"
backup_borg_postgresql_databases_username: "{{ devture_postgres_connection_username if devture_postgres_enabled else '' }}"
backup_borg_postgresql_databases_password: "{{ devture_postgres_connection_password if devture_postgres_enabled else '' }}"
backup_borg_postgresql_databases_port: "{{ devture_postgres_connection_port if devture_postgres_enabled else 5432 }}"
backup_borg_postgresql_databases: "{{ devture_postgres_managed_databases | map(attribute='name') if devture_postgres_enabled else [] }}"

backup_borg_location_source_directories:
  - "{{ my_data_path }}"

backup_borg_systemd_required_services_list: |
  {{
    ['docker.service']
    +
    ([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled else [])
  }}

A user must set a configuration like this in their vars.yml

backup_borg_enabled: true
backup_borg_location_repositories:
 - ssh://user@host/./repo
backup_borg_storage_encryption_passphrase: "verysecret"
backup_borg_ssh_key_private: |
  -----BEGIN OPENSSH PRIVATE KEY-----
  ladlfjahfuinsjklydnhawfmf
  adsjfajgiuhesrgadsjfahfuihaewuighf
  adfnkajfkstrhguihewzgkgbkgtrjguishg
  asdjfioghuifskermvbsjfhawuifui
  -----END OPENSSH PRIVATE KEY-----

ansible.role.backup_borg's People

Contributors

moan0s 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.