dbrennand.autorestic
Ansible Role: dbrennand.autorestic
Ansibleの役割は、autoresticを使用してバックアップを設定します。
要件
特にありません。
前提条件
この役割は、autoresticとresticのバイナリをそれぞれ/opt/autorestic/bin
と/opt/restic/bin
に配置します。シンボリックリンクが/usr/local/bin
に作成されます。
役割の変数
autorestic_architecture: mips
独自の特殊な組み合わせがある場合は、ansible_architecture
をオーバーライドします。詳細は依存関係を参照してください。
autorestic_version: 1.7.7
autorestic_restic_version: 0.15.1
インストールするautoresticとresticのバージョンです。
autorestic_install_directory:
path: /opt/autorestic/bin
# オプション
# owner: owner
# group: group
# mode: 0700
autorestic_restic_install_directory:
path: /opt/restic/bin
# ...
autoresticとresticのバイナリをインストールするディレクトリです。
autorestic_config:
version: 2
locations:
home:
from: /home/me
to: remote
# 毎週月曜日
cron: "0 0 * * MON"
backends:
remote:
type: b2
path: 'myBucket:backup/home'
env:
B2_ACCOUNT_ID: ID
B2_ACCOUNT_KEY: Key
YAML設定の詳細については、autoresticのドキュメントを参照してください。
autorestic_config_template: autorestic.yml.j2
autoresticのYAML設定に使用するautorestic.yml.j2
テンプレートです。デフォルトではautorestic_config
の内容がテンプレート化されます。カスタムテンプレートを使うには上書きできます。例については#14を参照してください。
autorestic_config_file: ~/.autorestic.yml
~/.autorestic.yml
ファイルに配置されるautoresticのYAML設定です。
autorestic_info: false
autoresticのYAML設定が有効であることを確認するためにautorestic info
を実行するかどうか。
autorestic_check: false
バックエンドが正しく設定されているか確認し、設定されていない場合は初期化するためにautorestic check
を実行するかどうか。
autorestic_cron: false
autorestic_cron_verbose: false
自動バックアップをトリガーするためのautorestic crontabエントリを作成するかどうか。autorestic_cron_verbose
を使用すると詳細なログが有効になります。autoresticの場所はcron
で設定する必要があります。
autorestic_state: present
autorestic、restic、設定、およびcrontabエントリを削除するかどうか。削除する場合はabsent
に設定してください。
これによりバックエンドおよびそのデータには影響しません。
依存関係
この役割は、GitHubに公開された事前コンパイル済みバイナリに依存しています。
autorestic_architecture
を使用する場合は、サポートされているバイナリアーキテクチャのリリースアセットを参照してください。
例のプレイブック
- hosts: all
roles:
- dbrennand.autorestic
モルキュールテスト 🧪
役割をテストするには、モルキュールを使用します: molecule test
ライセンス
このプロジェクトはMITライセンスの下でライセンスされています - 詳細はLICENSEを参照してください。
著者&貢献者
dbrennand - 著者
whysthatso - 貢献者
PleaseStopAsking - 貢献者
markstos - 貢献者
micxer - 貢献者
ansible-galaxy install dbrennand.autorestic