community.general.beadm 模块 – 在 FreeBSD/Solaris/illumos 系统上管理 ZFS 引导环境
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。
要在 playbook 中使用它,请指定:community.general.beadm。
概要
- 创建、删除或激活 ZFS 引导环境。 
- 挂载和卸载 ZFS 引导环境。 
参数
| 参数 | 注释 | 
|---|---|
| 将描述与新的引导环境关联。此选项仅在 Solarish 平台上可用。 | |
| 指定是否应强制卸载。 选择 
 | |
| 要挂载 ZFS 引导环境的路径。 | |
| ZFS 引导环境名称。 | |
| 使用特定的 ZFS 属性为新的 BE 创建数据集。 可以指定多个选项。 此选项仅在 Solarish 平台上可用。 | |
| 如果指定,则将从给定的快照或非活动引导环境克隆新的引导环境。 | |
| 创建或删除 ZFS 引导环境。 选择 
 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持: 完整 | 可以在  | |
| 支持: 无 | 在 diff 模式下,将返回有关已更改的内容(或可能需要在  | 
示例
- name: Create ZFS boot environment
  community.general.beadm:
    name: upgrade-be
    state: present
- name: Create ZFS boot environment from existing inactive boot environment
  community.general.beadm:
    name: upgrade-be
    snapshot: be@old
    state: present
- name: Create ZFS boot environment with compression enabled and description "upgrade"
  community.general.beadm:
    name: upgrade-be
    options: "compression=on"
    description: upgrade
    state: present
- name: Delete ZFS boot environment
  community.general.beadm:
    name: old-be
    state: absent
- name: Mount ZFS boot environment on /tmp/be
  community.general.beadm:
    name: BE
    mountpoint: /tmp/be
    state: mounted
- name: Unmount ZFS boot environment
  community.general.beadm:
    name: BE
    state: unmounted
- name: Activate ZFS boot environment
  community.general.beadm:
    name: upgrade-be
    state: activated
返回值
常见的返回值记录在这里,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| BE 描述 返回: 总是 示例:  | |
| 如果需要强制操作 返回: 总是 示例:  | |
| BE 挂载点 返回: 总是 示例:  | |
| BE 名称 返回: 总是 示例:  | |
| BE 附加选项 返回: 总是 示例:  | |
| 用于创建 BE 的 ZFS 快照 返回: 总是 示例:  | |
| 目标状态 返回: 总是 示例:  | 
