coaxial.backup

Backup Role

This Ansible role will set up tarsnap and tarsnapper to create encrypted backups regularly.

These backups are stored using tarsnap, which utilizes Amazon S3.

Learn more about Tarsnap, online backups for the truly paranoid.

Requirements

  • A tarsnap account with funds
  • This role is tested only on Ubuntu 16.04 (I can expand it to other platforms if there's interest; let me know by opening an issue)
  • A tarsnapper configuration file located at templates/tarsnapper.yml.j2 in your playbook (how to write a tarsnapper config file)
  • A tarsnap configuration file located at templates/tarsnap.conf.j2 in your playbook (how to write a tarsnap config file)

Role Variables

Variable Default Value Purpose
backup__rebuild_cache false Will skip tarsnap --fsck
backup__tarsnap_cachedir /usr/local/tarsnap-cache Directory for tarsnap to cache backups
backup__tarsnap_keyfile /root/tarsnap.key Path for saving the tarsnap key
backup__tarsnap_apt_key 40B98B68F04DE775 Key ID used to sign the tarsnap package
backup__tarsnap_username [email protected] Tarsnap.com username (needed only for generating a new key)
backup__tarsnap_password encrypt me Tarsnap.com password (needed only for generating a new key)
backup__tarsnapper_config_file /etc/tarsnapper.yml Path for saving tarsnapper jobs configuration
backup__tarsnapper_log_file /var/log/tarsnapper.log Path for writing cronjob logs
backup__cron_{minute,hour,dom,month,dow} respectively: 28, 3, *, *, * When to run tarsnap for backups

Notes

  • If no tarsnap key file is found at files/{{ ansible_hostname }}.yml, a new key will be created using the backup__tarsnap_username and backup__tarsnap_password variables, and a new machine will be registered as {{ ansible_host }}.
  • If a tarsnap key exists at files/{{ ansible_hostname }}.yml, that key will be used, and no new key or registration will happen.
  • If the task to add the tarsnap apt key fails, it likely means the package's key has changed. Check the current key at https://www.tarsnap.com/pkg-deb.html, update it using the backup__tarsnap_apt_key variable, and please open an issue so I can update this role.

Dependencies

None.

Example Playbook

- hosts: all
  roles:
    - role: coaxial.backup

License

MIT

Author Information

Coaxial <64b.it>

Informazioni sul progetto

Automated, encrypted, online backups using tarsnap

Installa
ansible-galaxy install coaxial.backup
Licenza
Unknown
Download
300
Proprietario