ansible-samba icon indicating copy to clipboard operation
ansible-samba copied to clipboard

print_hash replaces spaces with underscores

Open pigulla opened this issue 9 years ago • 9 comments

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?

pigulla avatar Nov 16 '16 17:11 pigulla

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.

drybjed avatar Nov 16 '16 17:11 drybjed

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?

pigulla avatar Nov 17 '16 06:11 pigulla

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.

drybjed avatar Nov 17 '16 08:11 drybjed

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!

pigulla avatar Nov 17 '16 08:11 pigulla

Any updates on this?

pigulla avatar Apr 06 '17 10:04 pigulla

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.

drybjed avatar Apr 06 '17 10:04 drybjed

Any plans on revising this role?

pigulla avatar Apr 20 '18 13:04 pigulla

@pigulla Yes, but that will most likely happen in the DebOps monorepo, you might consider switching to the new codebase.

drybjed avatar Apr 20 '18 15:04 drybjed

I'll take a look, thanks!

pigulla avatar Apr 23 '18 11:04 pigulla