community.general.zpool_facts module – Gather facts about ZFS pools
Note
This module is part of the community.general collection (version 10.1.0).
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.zpool_facts
.
Synopsis
Gather facts from ZFS pool properties.
Parameters
Parameter |
Comments |
---|---|
ZFS pool 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 zpool(1M) man page. Default: |
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 pool rpool
community.general.zpool_facts: pool=rpool
- name: Gather space usage about all imported ZFS pools
community.general.zpool_facts: properties='free,size'
- name: Print gathered information
ansible.builtin.debug:
msg: 'ZFS pool {{ item.name }} has {{ item.free }} free space out of {{ item.size }}.'
with_items: '{{ ansible_zfs_pools }}'
Returned Facts
Facts returned by this module are added/updated in the hostvars
host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.
Key |
Description |
---|---|
ZFS pool facts Returned: always Sample: |
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
ZFS pool name Returned: always Sample: |
|
if parsable output should be provided in machine friendly format. Returned: if ‘parsable’ is set to True Sample: |