Skip to content

community.general.zfs: no changed status on extra_zfs_properties changes #11019

@AceSlash

Description

@AceSlash

Summary

Incorrect changed status when a properties was set previously on a dataset.

Issue Type

Bug Report

Component Name

community.general.zfs

Ansible Version

$ ansible --version
ansible [core 2.19.3]
  config file = /home/redacted/.ansible.cfg
  configured module search path = ['/home/redacted/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/redacted/redacted/ansible/.venv/lib64/python3.13/site-packages/ansible
  ansible collection location = /home/redacted/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/redacted/redacted/ansible/.venv/bin/ansible
  python version = 3.13.9 (main, Oct 14 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] (/home/redacted/redacted/ansible/.venv/bin/python)
  jinja version = 3.1.5
  pyyaml version = 6.0.2 (with libyaml v0.2.5)

Community.general Version

$ ansible-galaxy collection list community.general

# /home/redacted/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 11.4.0 

# /home/redacted/redacted/ansible/.venv/lib/python3.13/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 11.4.0 

# /home/redacted/redacted/ansible/.venv/lib64/python3.13/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 11.4.0 

Configuration

OS / Environment

No response

Steps to Reproduce

On one dataset, I have the setting compression=zstd, this setting was set manually:

# zfs get compress tank
NAME  PROPERTY     VALUE           SOURCE
tank  compression  zstd            local

When using the module community.general.zfs with extra_zfs_properties to change it to lz4, ansible reports no changes.

But the module did change correctly the setting:

# zfs get compress tank
NAME  PROPERTY     VALUE           SOURCE
tank  compression  lz4             local

When I change the setting to be inherited instead:

# zfs get compress tank
NAME  PROPERTY     VALUE           SOURCE
tank  compression  on              default

And reruning ansible exactly the same way, ansible correctly report a change:

 {
     "extra_zfs_properties": {
-        "compression": null
+        "compression": "zstd"
     }

So whenever a properties is inherited (default value), it correctly reports changes, but if the value was set before, it doesn't.

Example step:

- name: set compression to lz4
  community.general.zfs:
    name: tank
    state: present
    extra_zfs_properties:
      compression: lz4

Expected Results

The module should report that a properties was changed on all changes, not only when it was changed from the default value.

Actual Results

No response

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions