Documentation

zfs_facts - Gather facts about ZFS datasets.

New in version 2.3.

Synopsis

  • Gather facts from ZFS dataset properties.

Options

parameter required default choices comments
depth
no None
Specifiies recurion depth.
name
yes
ZFS dataset name.

aliases: ds, dataset
parsable
no
  • yes
  • no
Specifies if property values should be displayed in machine friendly format.
properties
no all
Specifies which dataset properties should be queried in comma-separated format. For more information about dataset properties, check zfs(1M) man page.

aliases: props
recurse
no
  • yes
  • no
Specifies if properties for any children should be recursively displayed.
type
no all
  • all
  • filesystem
  • volume
  • snapshot
  • bookmark
Specifies which datasets types to display. Multiple values have to be provided in comma-separated form.

aliases: props

Examples

- name: Gather facts about ZFS dataset rpool/export/home
  zfs_facts:
    dataset: rpool/export/home

- name: Report space usage on ZFS filesystems under data/home
  zfs_facts:
    name: data/home
    recurse: yes
    type: filesystem

- 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 Return Values, the following are the fields unique to this module:

name description returned type sample
parsable
if parsable output should be provided in machine friendly format.
if 'parsable' is set to True boolean True
recurse
if we should recurse over ZFS dataset
if 'recurse' is set to True boolean True
name
ZFS dataset name
always string rpool/var/spool
zfs_datasets
ZFS dataset facts
always string {'setuid': 'on', 'referenced': '29.5K', 'logicalused': '3.45G', 'zoned': 'off', 'primarycache': 'all', 'logbias': 'latency', 'creation': 'Thu Jun 16 11:37 2016', 'sync': 'standard', 'copies': '1', 'sharenfs': 'off', 'usedbyrefreservation': '0', 'sharesmb': 'off', 'canmount': 'on', 'mountpoint': '/rpool', 'casesensitivity': 'sensitive', 'utf8only': 'off', 'usedbysnapshots': '0', 'readonly': 'off', 'mounted': 'yes', 'compression': 'off', 'xattr': 'on', 'aclmode': 'discard', 'dedup': 'off', 'snapshot_limit': 'none', 'aclinherit': 'restricted', 'compressratio': '1.00x', 'written': '29.5K', 'version': '5', 'normalization': 'none', 'filesystem_limit': 'none', 'type': 'filesystem', 'secondarycache': 'all', 'logicalreferenced': '18.5K', 'available': '43.8G', 'used': '4.41G', 'exec': 'on', 'refquota': 'none', 'refcompressratio': '1.00x', 'quota': 'none', 'snapshot_count': 'none', 'vscan': 'off', 'reservation': 'none', 'atime': 'on', 'recordsize': '128K', 'usedbychildren': '4.41G', 'usedbydataset': '29.5K', 'org.openindiana.caiman:install': 'ready', 'name': 'rpool', 'mlslabel': 'none', 'redundant_metadata': 'all', 'filesystem_count': 'none', 'devices': 'on', 'nbmand': 'off', 'refreservation': 'none', 'checksum': 'on', 'snapdir': 'hidden'}


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.