community.general.lbu 模块 – Alpine Linux 的本地备份工具

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

如果您使用的是 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.general

要在 playbook 中使用它,请指定:community.general.lbu

community.general 0.2.0 中的新增功能

概要

  • 在从 RAM 运行模式下管理 Alpine Linux 的本地备份工具

参数

参数

注释

提交

布尔值

控制是否提交更改的文件。

选择

  • false

  • true

排除

列表 / 元素=字符串

要排除的路径列表。

包括

列表 / 元素=字符串

要包括的路径列表。

属性

属性

支持

描述

check_mode

支持: 完全

可以在 check_mode 中运行,并返回更改状态预测,而无需修改目标。

diff_mode

支持:

在 diff 模式下,将返回有关已更改内容(或可能需要在 check_mode 中更改的内容)的详细信息。

示例

# Commit changed files (if any)
- name: Commit
  community.general.lbu:
    commit: true

# Exclude path and commit
- name: Exclude directory
  community.general.lbu:
    commit: true
    exclude:
    - /etc/opt

# Include paths without committing
- name: Include file and directory
  community.general.lbu:
    include:
    - /root/.ssh/authorized_keys
    - /var/lib/misc

返回值

常见的返回值记录在此处,以下是此模块特有的字段

描述

msg

字符串

错误消息

返回: 失败时

作者

  • Kaarle Ritvanen (@kunkku)