l3d.restic_archiver

ansible_role_restic_archiver

resticバックアップを「アーカイブ」するためのAnsibleロールです。

このロールのシナリオは次の通りです:

  • 書き込み専用モードで動作するresticレストサーバーがあります。
  • 他のサーバーからresticバックアップサーバーにバックアップを送信します。

すべてのバックアップを無期限に保存するのではなく、直近の日数分は毎日のバックアップを保管し、それ以外は週ごと、月ごと、年ごとに少しだけ保存します。

もちろん、他の人にアクセスを許可したくないので、全体をローカルのcronジョブで解決します。このcronジョブは、このAnsibleロールを使って構築されます。

ボーナス機能として、バックアップを別のディスクに転送することも可能です(異なるパスワードでも可)。これは、セキュリティの観点から非常に魅力的なバックアップの概念です。

このロールはresticをインストールしません。そのため、こちらのAnsibleロールを推奨します。 resticレストサーバー用のロールは良好な結果を得ています。

変数:

---
# デフォルトでクリーンアップするリポジトリ
restic_archiver__repos: {}
#  - name: example_server:
#    location: /srv/restic/example_server_repo
#    password: securepassword4eXaMpleSserver
#  - name: other_server
#    location: /srv/restic/other_server_repo
#    password: xtrasecuredifferentpassword4other
#    archive: true
#    archive_location: /mnt/archive/other_server_repo
#    archive_password: archive4other_server_password
#    archive_cleanup: true
#    keep_last: 5
#    keep_hourly: 4
#    keep_daily: 1
#    keep_weekly: 1
#    keep_monthly: 1
#    keep_yearly: 1
#    keep_within: 1
#    prune: true

# デフォルトでバックアップを保存する期間
restic_archiver__keep: 5
restic_archiver__keep_hourly: 16
restic_archiver__keep_daily: 14
restic_archiver__keep_weekly: 8
restic_archiver__keep_monthly: 16
restic_archiver__keep_yearly: 12

# すべてのresticの所有者とユーザー
restic_archiver__owner: 'root'
restic_archiver__group: 'root'

# resticのcronジョブをスケジュールする
restic_archiver__hour: '3'
restic_archiver__minute: '32'

# ディスクがマウントされているか確認
restic_archiver__mount_required: false
# マウントすべきディスク
restic_archiver__mount_disk: '/mnt/'
# 使用後にアンマウントするか?
restic_archiver__umount_after_usage: false

# 必要なパッケージ
restic_archiver__package:
  - cron

restic_archiver__log_output: true
restic_archiver__logrotate: true

restic_archiver__mailsummary: false
restic_archiver__mail_on_error: false
restic_archiver__mailaddress: 'root@localhost'

# resticのデフォルトオプション
restic_archiver__default_opt: ''

# 追加メッセージ
restic_archiver__additional_mail_msg: ''
# このプレイブックのバージョンチェック(true推奨)
submodules_versioncheck: false

restic_archiver__cache_config: false
restic_archiver__cache_dir: '~/.cache/restic'
restic_archiver__prune: false
プロジェクトについて

Role to deploy restic and setup backups.

インストール
ansible-galaxy install l3d.restic_archiver
ライセンス
mit
ダウンロード
276
所有者
Ansible roles provide a framework for fully independent, or interdependent collections of variables,tasks,files,templates &modules. Here we maintain some. enjoy