Open rbadass opened 2 years ago
Files identified in the description:
plugins/modules/packaging/os/pkg5
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @bcoca @fishman @jasperla @jpdasma @mator @mavit @scathatheworm @troy2914 @xen0l click here for bot help
!component =plugins/modules/storage/zfs/zfs.py
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @johanwiren click here for bot help
This should have been fixed in #1833. Are you sure you tried this also with community.general 4.6.0, and not just with community.general 1.3.0 (which is EOL btw)?
This should have been fixed in #1833. Are you sure you tried this also with community.general 4.6.0, and not just with community.general 1.3.0 (which is EOL btw)?
i just updated and tried again, the problem persists
$ ansible-galaxy collection list community.general community.general 4.8.1
When I change volblocksize = 4k
to vloblocksize = 4096
, task become "ok".
I don't know why volsize = 4G
is good but volblocksize = 4k
is not.
Same thing with the encryption
property:
The following can only one once, every other time it errors:
- name: create encrypted guest zfs volume
community.general.zfs:
name: "{{ zfs_encrypted_guest_dataset }}"
state: present
extra_zfs_properties:
encryption: on
keyformat: hex
keylocation: file:///root/.rpool-data-encrypted.key
compression: zstd-3
TASK [rmblr.proxmox_setup : create encrypted guest zfs volume ] ********************
fatal: [mill]: FAILED! => changed=false
cmd: /usr/sbin/zfs set encryption=on rpool/data/encrypted
msg: 'cannot set property for ''rpool/data/encrypted'': ''encryption'' is readonly'
rc: 1
stderr: |-
cannot set property for 'rpool/data/encrypted': 'encryption' is readonly
stderr_lines: <omitted>
stdout: ''
stdout_lines: <omitted>
Using community.general==6.3.0
Analysis
Looking at the code, the module is parsing the result of essentially this (filtered down to the encryption property):
$ zfs get -H -p -o property,value,source all rpool/data/encrypted|grep encryption
encryption aes-256-gcm -
encryptionroot rpool/data/encrypted -
Note that the playbook called for encryption=on
. In modern ZFS (2.1.9) this is equivalent to aes-256-gcm
in previous versions the default encryption value was different.
Changing the playbook to use encryption: aes-256-gcm
makes it idempotent.
Hello!
Any plans on fixing this issue?
I'm not aware of anyone working on this.
Summary
When running the following: community.general.zfs: name: pool/vol1 state: present extra_zfs_properties: volsize: 4G volblocksize: 4k
the initial run succeeds and creates the zvol, however subsequent runs fail with: FAILED! => {"changed": false, "msg": "cannot set property for 'pool/vol1': 'volblocksize' is readonly\n"}
it should simply skip over and not try to set volblocksize as it's already at the correct volblocksize.
Issue Type
Bug Report
Component Name
zfs
Ansible Version
Community.general Version
Configuration
OS / Environment
No response
Steps to Reproduce
community.general.zfs: name: pool/vol1 state: present extra_zfs_properties: volsize: 4G volblocksize: 4k
Expected Results
I expected it to skip over a property that was already set correctly.
Actual Results
It tried to re-set the volblocksize property, which is readonly and thus throws an error.
Code of Conduct