l3d.restic_archiver

ansible_role_restic_archiver

这是一个用于“归档”restic备份的Ansible角色。

这个角色的场景是:

  • 你有一个以只写模式运行的restic备份服务器
  • 你将其他服务器的备份发送到你的restic备份服务器

现在你不想无限期存储所有备份,而只希望保留最近几天的日常备份,以及每周、每月、每年的备份……就像你通常做的那样。

当然,你不想给其他人提供访问权限,因此你通过本地cronjob解决了这个问题。这个cronjob是通过这个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的cronjob
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