2021-02-07 10:53:08 +01:00
|
|
|
## mgrote.zfs_sanoid
|
2020-08-18 11:57:53 +02:00
|
|
|
|
|
|
|
### Beschreibung
|
2023-07-05 11:47:57 +02:00
|
|
|
Installiert und konfiguriert ``sanoid`` + ``syncoid``.
|
|
|
|
|
|
|
|
Es gibt 3 Funktionen:
|
|
|
|
|
|
|
|
1. Snapshots erstellen und entfernen
|
|
|
|
2. Snapshots senden
|
|
|
|
3. Snapshots empfangen
|
2020-08-18 11:57:53 +02:00
|
|
|
|
2021-07-16 12:52:43 +02:00
|
|
|
### getestet auf
|
2023-07-05 11:47:57 +02:00
|
|
|
- ProxMox 7.*
|
|
|
|
- Ubuntu 20.04
|
2020-08-18 11:57:53 +02:00
|
|
|
|
|
|
|
### Variablen + Defaults
|
2021-11-23 21:04:03 +01:00
|
|
|
- see [defaults](./defaults/main.yml)
|
2023-07-05 11:47:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
### Beispiel Playbook
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
---
|
|
|
|
- hosts: host1,host2
|
|
|
|
roles:
|
2023-10-25 22:26:17 +02:00
|
|
|
- { role: mgrote_zfs_sanoid, tags: "sanoid" }
|
2023-07-05 11:47:57 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
### Beispiel - Snapshots erstellen
|
|
|
|
|
|
|
|
|
|
|
|
#### Variablen
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
---
|
|
|
|
sanoid_snaps_enable: true
|
|
|
|
sanoid_datasets:
|
2023-11-29 22:24:57 +01:00
|
|
|
- path: 'hdd_data/videos'
|
2023-07-05 11:47:57 +02:00
|
|
|
template: '31tage'
|
|
|
|
recursive: 'yes'
|
|
|
|
snapshots: true
|
|
|
|
sanoid_templates:
|
|
|
|
- name: '31tage'
|
|
|
|
keep_hourly: '24' # Aufheben (Stunde)
|
|
|
|
keep_daily: '31' # Aufheben (Tage)
|
|
|
|
keep_monthly: '3' # Aufheben (Monate)
|
|
|
|
keep_yearly: '0' # Aufheben (Jahre)
|
|
|
|
frequently: '16' # Aufheben (Minuten)
|
|
|
|
frequent_period: '15' # Intervall (alle 5 Minuten)
|
|
|
|
autosnap: 'yes' # Automatisches erstellen von Snapshots
|
|
|
|
autoprune: 'yes'
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
### Beispiel - Snapshots senden und empfangen
|
|
|
|
|
|
|
|
- Host 1 = Source
|
|
|
|
- Host 2 = Destination
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Variablen - Host 1
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
sanoid_syncoid_source_host: true
|
|
|
|
sanoid_syncoid_ssh_pubkey: |
|
|
|
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC3U37DGPRPDLlgxZcM0Zj/x6RVZxs7hcWBYfPywujH4+mjbpzJckr2tx3QLfxsCCjQVb4LNSEB0xsOvzDjfDsaPuG4wzqFVyZOtjI4iWg/it4ARndun33r+xSlWc5JKHH9GRK8SBOd4lXv5ylENdhWQ7z5ZF/FtCysb1JHTTYlobgXfTZ4NswJj6BBk669l13uL6zSXq6x6vm1GWiFIcIYqwM5WGSGHFoD2RNn0TJKI9A3AULPloMzWeHG3fJhoVfNY6ZB0kqpTHGoAmJUURkBFki1cJkzx3tyto4VpTzZmUyYg+qqIWbv7Me3YVJCln8JYD10uDb2oPRx6G3C9DlnzRmAVVbqCHzwvOY0H5TLTW7AXCHHgSdHaRym4oTUY9dDS/XFU3rHgexerBbi3sy1Tm0/dEU3cZFm4YOJXY/l4TeTRlhg2VbctsWE1BN1CZcoJRR+qNdJzM7Vl70Y6RGU92Y1rzSpooYVuyCFDrEIp0hAHidb5rs4paCvoxtVqak+LK8dcq0IbWxcxomEimeRG4+Opd3vo+U6subp5jqkOY0uYkFVJXaMHkP5ZIxlCFgif2A3YAPhz9IczRJaaNY3pbVgU7ybOBp+S8KRK8Ysk6OP5ApOTQVTlRhYeNqo7mpuW6139VRY5luekSCy3ehHCI9/MObhu2juF1Nz0HMeMQ== mg@irantu
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### Variablen - Host 2
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
sanoid_syncoid_timer: '*:*'
|
|
|
|
sanoid_syncoid_bwlimit: 30m
|
|
|
|
sanoid_syncoid_datasets_sync:
|
|
|
|
- source_host: host1.lan
|
|
|
|
source_dataset: hdd_data_mirror
|
2023-11-29 22:24:57 +01:00
|
|
|
destination_mount_check: hdd_data/encrypted # Wenn dieses Dataset nicht gemountet ist(z.B. durch Verschlüsselung, dann bricht syncoid ab)
|
|
|
|
destination_dataset: hdd_data/encrypted/syncoid/zfs1
|
2023-07-05 11:47:57 +02:00
|
|
|
skip_parent: false
|
|
|
|
sanoid_syncoid_ssh_privkey: "{{ lookup('keepass', 'sanoid_syncoid_private_key', 'notes') }}"
|
|
|
|
sanoid_syncoid_destination_host: true
|
|
|
|
|
|
|
|
```
|