buluma.restore
Ansible角色 restore
这个角色的目的是将对象恢复到你的系统中。
GitHub | 版本 | 问题 | 拉取请求 | 下载 |
---|---|---|---|---|
示例剧本
这个示例来自 molecule/default/converge.yml
,并在每次推送、拉取请求和发布时进行测试。
---
- name: Converge
hosts: all
become: true
gather_facts: true
roles:
- role: buluma.restore
机器需要准备好。在CI中,这通过 molecule/default/prepare.yml
完成:
---
- name: 准备
hosts: all
gather_facts: false
become: true
roles:
- role: buluma.bootstrap
- role: buluma.core_dependencies
- role: buluma.mysql
- role: buluma.buildtools
- role: buluma.epel
- role: buluma.python_pip
- role: buluma.postgres
详情请参见 完整解释和示例 了解如何使用这些角色。
角色变量
变量的默认值在 defaults/main.yml
中设置:
---
# restore的默认文件
# 要恢复的对象保存在哪个目录?
restore_directory: backups
# 需要临时放置在管理节点上的对象目录。
restore_remote_directory: /tmp
# 登录mysql数据库的凭据,仅在恢复mysql对象时需要。
# restore_mysql_username: "my_user"
# restore_mysql_password: "my_pass"
# 需要恢复的对象列表。
# 每个列表项应包含:
# - 用于在本地找到对象的名称。
# 类型,可以是目录或mysql。
# 目的地,解压对象的目录。
#
# 注意:可以使用 [备份角色](http://galaxy.ansible.com/buluma/backup) 创建可恢复的对象。使用此角色创建的对象包括父目录,因此这里提到的目的地~缺失~目录的最后一部分。
restore_objects:
- name: varspool
type: directory
destination: /var
# - name: drupal
# type: mysql
# destination: drupal
要求
- 在 requirements.txt 中列出的pip包。
所用角色的状态
以下角色用于准备系统。您可以用其他方式准备系统。
需求 | GitHub | 版本 |
---|---|---|
buluma.backup | ||
buluma.bootstrap | ||
buluma.core_dependencies | ||
buluma.mysql | ||
buluma.buildtools | ||
buluma.epel | ||
buluma.python_pip | ||
buluma.postgres |
上下文
这个角色是多个兼容角色的一部分。有关更多信息,请参阅 这些角色的文档。
以下是相关角色的概述:
兼容性
此角色在以下 容器镜像 上进行了测试:
容器 | 标签 |
---|---|
EL | 8, 9 |
Fedora | 38, 39, 40 |
opensuse | 所有 |
所需的最低Ansible版本为2.12,测试已在以下版本上完成:
- 之前的版本。
- 当前版本。
- 开发版本。
如果发现问题,请在 GitHub 上注册。