* zfs.py: treated received properties as local and added diff mode support
If you use "zfs set" to explicitly set ZFS properties, they are marked as from source "local". If ZFS properties are implicitly set by using "zfs send" and "zfs receive", for example as part of a template based installation, they are marked as from source "received". But as there is no technical difference between both types of them, the “received” ZFS properties should also be considered “local”. Otherwise Ansible would detect changes, which aren’t actual changes. Therefore I changed line 202/207 to reflect this.
For us it’s quite important, that Ansible modules support the diff mode in order to qualify changes. Therefore I added some code lines to address this.
* added changelog fragment for PR #502
* fixed typos in changelog fragment for PR #502
* minor changes in changelog fragment for PR #502
* added link to pull request in changelog fragment for PR #502
* extended the diff data structure to always include the name of the zfs filesystem
* added code to also maintain the diff data structure after a change
* reverted back some code lines for better code readability
* added an extra dict in the diff data structure to hold the zfs properties
* Avoid incorrectly marking zfs tasks as changed
The zfs module will incorrectly mark certain tasks as having been
changed. For example, if a dataset has a quota of "1G" and the user
changes it to "1024M", the actual quota vale has not changed, but since
the module is doing a simple string comparison between "1G" and "1024M",
it marks the step as "changed".
Instead of trying to handle all the corner cases of zfs (another example
is when the zpool "altroot" property has been set), this change simply
compares the output of "zfs-get" from before and after "zfs-set" is
called
* update changelog format
* Update changelogs/fragments/2454-detect_zfs_changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* add note about check_mode
* Update plugins/modules/storage/zfs/zfs.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/storage/zfs/zfs.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* clarify check mode qualifications
* rephrase to avoid hypothetical
Co-authored-by: Felix Fontein <felix@fontein.de>
* avoid errors with creation-only properties
* add changelog fragment
* Apply suggestion to changelog fragment
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* fixed validation-modules for plugins/modules/storage/zfs/zfs.py
* fixed validation-modules for plugins/modules/storage/zfs/zfs_delegate_admin.py
* fixed validation-modules for plugins/modules/storage/zfs/zfs_facts.py
* fixed validation-modules for plugins/modules/storage/zfs/zpool_facts.py
* Tidy up validate-modules ignores for storage/zfs modules
* removed ignore lines in 2.11 files as well
* added changelog fragment per PR
* Update changelogs/fragments/1766-zfs-fixed-sanity.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>