zpool_facts - Gather facts about ZFS pools.¶
New in version 2.3.
Parameters¶
Parameter | Choices/Defaults | Comments |
---|---|---|
name |
ZFS pool name.
aliases: pool, zpool |
|
parsable
bool |
|
Specifies if property values should be displayed in machine friendly format.
|
properties |
Default: all
|
Specifies which dataset properties should be queried in comma-separated format. For more information about dataset properties, check zpool(1M) man page.
aliases: props |
Examples¶
# Gather facts about ZFS pool rpool
- zpool_facts: pool=rpool
# Gather space usage about all imported ZFS pools
- zpool_facts: properties='free,size'
- 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.
Fact | Returned | Description |
---|---|---|
ansible_zfs_pools
string
|
always |
ZFS pool facts
Sample:
{'comment': '-', 'freeing': '0', 'listsnapshots': 'off', 'leaked': '0', '[email protected]': 'enabled', 'delegation': 'on', 'dedupditto': '0', 'dedupratio': '1.00x', 'autoexpand': 'off', '[email protected]': 'enabled', 'allocated': '3.46G', 'guid': '15729052870819522408', '[email protected]_blocks': 'enabled', '[email protected]_compress': 'active', '[email protected]_txg': 'active', 'autoreplace': 'off', 'capacity': '6%', '[email protected]_vdev_crash_dump': 'enabled', '[email protected]_dataset': 'enabled', 'cachefile': '-', 'bootfs': 'rpool/ROOT/openindiana', '[email protected]_birth': 'active', 'readonly': 'off', 'version': '-', 'health': 'ONLINE', 'expandsize': '-', '[email protected]_data': 'active', 'size': '49.8G', '[email protected]_destroy': 'enabled', '[email protected]': 'enabled', '[email protected]_bpobj': 'active', '[email protected]_histogram': 'active', 'free': '46.3G', 'failmode': 'wait', '[email protected]_limits': 'enabled', '[email protected]': 'enabled', 'altroot': '-', 'fragmentation': '3%', 'name': 'rpool'}
|
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
name
string
|
always |
ZFS pool name
Sample:
rpool
|
parsable
boolean
|
if 'parsable' is set to True |
if parsable output should be provided in machine friendly format.
Sample:
True
|
Status¶
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Maintenance¶
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Author¶
- Adam Števko (@xen0l)
Hint
If you notice any issues in this documentation you can edit this document to improve it.