community.general.xfs_quota 模块 – 管理 XFS 文件系统上的配额
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。您需要其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:community.general.xfs_quota。
概要
- 在 XFS 文件系统上配置配额。 
- 在使用此模块之前,需要配置 /etc/projects 和 /etc/projid。 
要求
执行此模块的主机需要以下要求。
- xfsprogs 
参数
| 参数 | 注释 | 
|---|---|
| 硬块配额限制。 此参数支持人类可读的大小。 | |
| 软块配额限制。 此参数支持人类可读的大小。 | |
| 硬 inode 配额限制。 | |
| 软 inode 配额限制。 | |
| 要应用配额的挂载点。 | |
| 要将配额应用到的用户、组或项目的名称,如果不是默认值。 | |
| 硬实时块配额限制。 此参数支持人类可读的大小。 | |
| 软实时块配额限制。 此参数支持人类可读的大小。 | |
| 是应用限制还是删除限制。 删除限制时,它们设置为 0,而不是完全删除。 选项 
 | |
| XFS 配额类型。 选项 
 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全 | 可以在  | |
| 支持:无 | 在 diff 模式下,将返回有关已更改内容(或可能需要在  | 
示例
- name: Set default project soft and hard limit on /opt of 1g
  community.general.xfs_quota:
    type: project
    mountpoint: /opt
    bsoft: 1g
    bhard: 1g
    state: present
- name: Remove the default limits on /opt
  community.general.xfs_quota:
    type: project
    mountpoint: /opt
    state: absent
- name: Set default soft user inode limits on /home of 1024 inodes and hard of 2048
  community.general.xfs_quota:
    type: user
    mountpoint: /home
    isoft: 1024
    ihard: 2048
返回值
常见的返回值记录在这里,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 当前 bhard 设置(以字节为单位) 返回: 总是 示例:  | |
| 当前 bsoft 设置(以字节为单位) 返回: 总是 示例:  | |
| 当前 ihard 设置(以字节为单位) 返回: 总是 示例:  | |
| 当前 isoft 设置(以字节为单位) 返回: 总是 示例:  | |
| 当前 rtbhard 设置(以字节为单位) 返回: 总是 示例:  | |
| 当前 rtbsoft 设置(以字节为单位) 返回: 总是 示例:  | 
