ansible-role--rsnapshot/README.md

61 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
# Ansible Role: rsnapshot
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
[![CI](https://github.com/glenux/ansible-role-rsnapshot/workflows/CI/badge.svg?event=push)](https://github.com/glenux/ansible-role-rsnapshot/actions?query=workflow%3ACI)
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
This role installs and configures rsnapshot on Debian-based systems.
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
## Requirements
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
This role has been tested on Debian 11 (Bullseye) and should work on other Debian-based systems.
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
## Role Variables
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
All variables are defined with their default values in `defaults/main.yml`. An exhaustive description of the variables is available in `criteria/variables.json`. Here are a few notable variables:
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
| Variable | Default Value | Description |
|-----------------------------|---------------------------|---------------------------------------------------------------------------------|
| `rsnapshot_snapshot_root` | `/var/lib/rsnapshot` | Root directory for storing snapshots. |
| `rsnapshot_retains` | `{"hourly": 6, "daily": 7, "weekly": 4, "monthly": 12 }` | Retention policy for snapshots. |
| `rsnapshot_backups` | `[]` | Array of backup configurations. See example below. |
| `rsnapshot_backup_scripts` | `[]` | Array of scripts to execute before backups. |
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
## Dependencies
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
None.
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
## Example Playbook
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
```yaml
- hosts: backupservers
become: true
roles:
- role: glenux.rsnapshot
vars:
rsnapshot_backups:
- remote:
user: backupuser
host: 192.168.1.10
paths:
- /etc
- /home
local: server1
- remote:
user: backupuser
host: 192.168.1.11
paths:
- /var/www
local: server2
rsnapshot_backup_scripts:
- /usr/local/bin/mysql_backup.sh
- /usr/local/bin/postgres_backup.sh
```
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
## License
2024-07-12 12:35:24 +00:00
2024-07-12 13:10:08 +00:00
This project is licensed under the BSD License - see the LICENSE file for details.
## Author Information
This role was created by [glenux](https://github.com/glenux).