outwire.restic
Ansibleロール: restic
resticとrunresticを使用してバックアップを設定します。
ロール変数
restic_version: 0.12.0
runrestic_version: 0.5.20
インストールするresticとrunresticのバージョンです。
restic_systemd_timer_oncalendar: daily
バックアップの作成とプルーニングが実行される日時の仕様です。systemdのドキュメンテーションで可能な値を確認できます。
runresticの設定
必須引数
restic_repository
: リポジトリへのパス。複数のリポジトリにバックアップしたい場合はリストにできます。
restic_password
: リポジトリのパスワード。
restic_source_directories
: バックアップするローカルフォルダのリスト。
任意の引数
restic_backup_name: restic backup
- バックアップの名前
restic_execution_parallel: true
- パラレルバックアップ作成restic_execution_retry_count: 10
- リトライ回数restic_execution_retry_backoff: 1:00 exponential
- リトライ戦略(静的、線形、指数)
restic_environment_variables: []
- restic用の環境変数、resticのドキュメンテーションで利用可能なオプションを確認できます。
restic_exclude_patterns: []
- バックアップから除外するパターンrestic_exclude_files: []
- バックアップから除外するファイル
restic_pre_hooks: []
- バックアップ前に実行するコマンドrestic_post_hooks: []
- バックアップ後に実行するコマンド
restic_retention_policy:
keep_last: 3
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
各カテゴリ(日次、週次、月次など)で保持するバックアップの数に対する保持ポリシーです。
restic_checks: []
整合性チェックのリストです。
restic_metrics_prometheus: false
restic_metrics_prometheus_path: /var/lib/node_exporter/textfile_collector/runrestic.prom
node_exporterテキストファイルコレクター用のPrometheusメトリクス。
restic_metrics_prometheus_password_replacement: XXX
- メトリクス内のリポジトリのパスワードを置き換えます。
例のプレイブック
ローカルバックアップ
- hosts: servers
vars:
restic_repository: /srv/restic-repo
restic_password: changeme
restic_source_directories:
- /var/www
- /etc
roles:
- { role: outwire.restic }
S3バックアップ
- hosts: servers
vars:
restic_repository: s3:s3.example.com/bucket123/backup
restic_password: changeme
restic_environment_variables:
AWS_ACCESS_KEY_ID: changeme_access_key
AWS_SECRET_ACCESS_KEY: changeme_secret_key
restic_source_directories:
- /var/www
- /etc
roles:
- { role: outwire.restic }
ライセンス
MIT