Skip to content

shawnheide/ansible-role-borgbackup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Borgbackup

Ansible Borgbackup role.

Features:

  • Repository or binary installation
  • Schedules regular backup jobs
  • Schedules regular prune jobs to keep backup windows clean
  • Flexible configuration to list backup targets

Role Variables

see defaults/main.yml

Example Playbook

- hosts: all
  roles:
    - role: SphericalElephant.borgbackup
      borgbackup_client: True
      borgbackup_client_backup_server: backup01.example.com
      borgbackup_create_jobs:
        - name: system
          day: "*"
          hour: "0"
          minute: "{{ 59 | random }}"
          directories:
            - /etc
            - /home
            - /var
          excludes:
            - 're:^/var/lib/apt'
            - 're:^/var/[^/]+\/cache/'
      borgbackup_prune_jobs:
        - name: system
          prune_options: "--keep-daily=7 --keep-weekly=4"
          day: "*"
          hour: "8"
          minute: "0"
      borgbackup_check_jobs:
        - name: system
          check_options: "--lock-wait 28800"
          day: "1"
          hour: "12"
          minute: "0"

You can easily assign client and server attributes from your inventory with something similar to the following:

borgbackup_client: "{{ (inventory_hostname in groups.borgbackup_server)|ternary(False, True) }}"
borgbackup_client_backup_server: "{{ groups.borgbackup_server[0] }}"

License

Apache 2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%