ansible-samba
ansible-samba copied to clipboard
print_hash replaces spaces with underscores
The print_hash macro replaces spaces with underscores. This breaks configuration of Samba's vfs_full_audit module which has options like full_audit:prefix.
What is the suggested workaround?
In that case I suppose that the role could either have a dictionary which defines cases like this to preserve current configuration model, or drop the replacing entirely and quote the Samba options. Do you know how many cases of options with underscores there would be? If it's significant amount, then the second option would probably be best.
I'm not sure, it's the first one I've come across. But then again, I'm not a frequent user of Samba and there might be others.
Personally, I'd prefer dropping the spaces-to-underscores magic altogether but since that is a pretty big BC break, adding a samba__global_literal is probably easier.
Or, alternatively, add a disable_underscore_magic option to the module? Wouldn't that be an easy non-BC-breaking change since it only requires a small modification to the print_hash function?
On the other hand, the role hadn't even had a v0.1.0 release yet. I think that the current version could be tagged, and then we can think about new configuration layout for v0.2.0.
It seems that I made mistake by designing how Samba is configured. We need to find a better alternative, prefarably one that can configure parameters conditionally (think item.state). I don't think that allowing for disabling underscore magic alone is a good choice, it would quickly lead to issues where you need to ask users if they disabled/enabled a setting to configure Samba properly. Not a good choice, IMO.
Honestly, I don't care either way and you have much more experience with Ansible than I do, so whatever you deem better is perfectly fine with me :)
I'm going to fork and patch this for our needs until you've had the time to decide on and implement a solution. Thanks!
Any updates on this?
Sorry, not at the moment, I have been focusing on other roles. debops.samba still needs to be redesigned, I'm not sure when I'll get around to it. My environment isn't really Samba-heavy. But I keep it in mind.
Any plans on revising this role?
@pigulla Yes, but that will most likely happen in the DebOps monorepo, you might consider switching to the new codebase.
I'll take a look, thanks!