community.general.zfs_facts module – Gather facts about ZFS datasets
Note
This module is part of the community.general collection (version 8.6.7).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.zfs_facts
.
Synopsis
Gather facts from ZFS dataset properties.
Aliases: storage.zfs.zfs_facts
Parameters
Parameter |
Comments |
---|---|
Specifies recursion depth. Default: |
|
ZFS dataset name. |
|
Specifies if property values should be displayed in machine friendly format. Choices:
|
|
Specifies which dataset properties should be queried in comma-separated format. For more information about dataset properties, check zfs(1M) man page. Default: |
|
Specifies if properties for any children should be recursively displayed. Choices:
|
|
Specifies which datasets types to display. Multiple values have to be provided in comma-separated form. Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Will return details on what has changed (or possibly needs changing in |
|
Support: full |
Action returns an |
Examples
- name: Gather facts about ZFS dataset rpool/export/home
community.general.zfs_facts:
dataset: rpool/export/home
- name: Report space usage on ZFS filesystems under data/home
community.general.zfs_facts:
name: data/home
recurse: true
type: filesystem
- ansible.builtin.debug:
msg: 'ZFS dataset {{ item.name }} consumes {{ item.used }} of disk space.'
with_items: '{{ ansible_zfs_datasets }}'
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
ZFS dataset name Returned: always Sample: |
|
if parsable output should be provided in machine friendly format. Returned: if ‘parsable’ is set to True Sample: |
|
if we should recurse over ZFS dataset Returned: if ‘recurse’ is set to True Sample: |
|
ZFS dataset facts Returned: always Sample: |