HanXHX.backuppc
BackupPC Ansible role
This role installs and configures Backuppc. It works on Debian Jessie. It can work on Ubuntu or other Debian-based systems. But no direct support will be added (PR accepted).
Requirements
None.
Note
At this time, this role only manage backup via rsync (+ ssh) method.
Role Variables
Role var
backuppc_server_name: fqdn of the backup serverbackuppc_ssh_key_bits: set length of ssh key pair (optional, default 2048 by Ansible)backuppc_fetch_ssh_key: copy backkupc ssh key from server (boolean)backuppc_local_fetch_dir: local dir where you fetch backuppc SSH public keybackuppc_hosts: clients list to backup (see below)
Client vars
Each client configuration override global configuration.
hostname: (M) hostname of the hoststate: (O) absent or present (default)include_files:: (O) default files (directories) list to backup.exclude_files:: (O) default files (directories) list to exclude in backupxfermethod: (O) transfer method (rsync as default)more: (O) hash with specific key/value (usefull for custom directives)
(O): Optional (M): Mandatory
Global configuration
You should RTFM for these variables:
backuppc_ServerPortbackuppc_ServerMesgSecretbackuppc_MaxBackupsbackuppc_MaxUserBackupsbackuppc_MaxBackupPCNightlyJobsbackuppc_BackupPCNightlyPeriodbackuppc_MaxOldLogFilesbackuppc_FullPeriodbackuppc_IncrPeriodbackuppc_PingMaxMsecbackuppc_RsyncClientCmdbackuppc_RsyncClientRestoreCmdbackuppc_BackupFilesOnlybackuppc_BackupFilesExcludebackuppc_XferLogLevel
Other global configuration can be managed (you can create issues or PR).
Notes
About HTTP
This role doesn't manage any webserver! You must use another role to install a HTTP service before this role. It doesn't manage any authentication.
Be careful, in Debian based systems, backuppc depends httpd virtual package. If you don't install any HTTP server, Debian will install Apache2. However, you can use my Nginx role which is compatible with this role.
About backups
This role downloads backuppc SSH public key. You must deploy it on each clients!
Dependencies
None.
Example Playbook
Quick and dirty
You should look at defaults/main.yml.
With my Nginx role
- hosts: backup
vars:
nginx_vhosts:
- name: backup.mydomain.tld
template: _backuppc
htpasswd: backuppc
nginx_htpasswd:
- name: backuppc
description: 'Please login'
users:
- name: hx
password: myPassword
backuppc_hosts:
- hostname: current-host
state: present
- hostname: removed_host
state: absent
- hostname: oldserver
roles:
- HanXHX.nginx
- HanXHX.backuppc
License
GPLv2
Donation
If this code helped you, or if you’ve used them for your projects, feel free to buy me some :beers:
- Bitcoin:
1BQwhBeszzWbUTyK4aUyq3SRg7rBSHcEQn - Ethereum:
63abe6b2648fd892816d87a31e3d9d4365a737b5 - Litecoin:
LeNDw34zQLX84VvhCGADNvHMEgb5QyFXyD - Monero:
45wbf7VdQAZS5EWUrPhen7Wo4hy7Pa7c7ZBdaWQSRowtd3CZ5vpVw5nTPphTuqVQrnYZC72FXDYyfP31uJmfSQ6qRXFy3bQ
No crypto-currency? :star: the project is also a way of saying thank you! :sunglasses:
Author Information
- Twitter: @hanxhx_
