Feature #37574
openAllow the use of custom prefix for snippets
Description
We recommend our users to clone default templates that are seeded in DB, instead of unlocking them and modify them directly. The reason is, on every upgrade, the customizations are overridden to the default version. If the user maintains the templates in external git repo and synchronizes all of them in Foreman through foreman_templates, all such templates can be prefixed with something. This is a typical flow, so users end up with templates like
"[acme] Kickstart Default"
Recently, we [[https://projects.theforeman.org/issues/35674|added several]] custom extension points, but they are constructed like this
<%= snippet_if_exists(template_name + " custom pre") -%>
Therefore it tries to load snippets like "[acme] Kickstart Default custom pre". That means also all the snippets need to be cloned and managed separately. This requires a lot of effort.
We should introduce a new Setting under Provisioning to specify a custom prefix, e.g. "[acme] ". If it is specified, both snippet and snippet_if_exists macros should first try to load prefixed snippet and if it does not exist, it should try it without the prefix. That way, the user has always a way to override the default behavior by prefixed version but also an option to continue using the default snippets.