local cache ~/.cdist/cache/<md5 hash> #134

Closed
opened 2021-11-20 13:24:29 +00:00 by ungleich-gitea · 2 comments

Created by: tom-ee

We now have documentation for Local cache overview thanks to @darko-poljak :)

The one thing I'm wondering about is the md5-hash of the hostname: It buys nothing for uniqueness. The allowed characters in a hostname are fine for naming a directory.

Would it be reasonable to change the cache path to ~/.cdist/cache/${__target_hostname} instead of ~/.cdist/cache/$(echo -n ${__target_hostname} | md5sum)?

I havn't checked or tested if any normalization of the hostname (it seems that __target_hostname is used) is done -- apologies for the lazyness. That's the only reason for making the hunt for the correct directory harder by using the md5 hash I could come up with.

*Created by: tom-ee* We now have documentation for `Local cache overview` thanks to @darko-poljak :) The one thing I'm wondering about is the md5-hash of the hostname: It buys nothing for uniqueness. The allowed characters in a hostname are fine for naming a directory. Would it be reasonable to change the cache path to `~/.cdist/cache/${__target_hostname}` instead of `~/.cdist/cache/$(echo -n ${__target_hostname} | md5sum)`? I havn't checked or tested if any normalization of the hostname (it seems that `__target_hostname` is used) is done -- apologies for the lazyness. That's the only reason for making the hunt for the correct directory harder by using the md5 hash I could come up with.
Author
Owner

Created by: tom-ee

Ah, that makes perfect sense. Thank you for the explanation.

*Created by: tom-ee* Ah, that makes perfect sense. Thank you for the explanation.
Author
Owner

Created by: darko-poljak

@tom-ee You can change host cache directory name, see CACHE PATH PATTERN FORMAT in cdist man page. This is also mentioned in local cache overview docs chapter.

It was changed from target host name because cdist can be used with custom remote_exec/copy and target host can be anything, not only valid hostnames. For example, for custom remote commands that work wich chroot target host can be a directory path.

*Created by: darko-poljak* @tom-ee You can change host cache directory name, see CACHE PATH PATTERN FORMAT in cdist man page. This is also mentioned in local cache overview docs chapter. It was changed from target host name because cdist can be used with custom remote_exec/copy and target host can be anything, not only valid hostnames. For example, for custom remote commands that work wich chroot target host can be a directory path.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ungleich-public/cdist#134
No description provided.