Preview function for provisioning templates is blank and the filter host dropdown list is blank.
Ability to preview a rendered template
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Distribution and version:
Rocky Linux 8.5
Other relevant data:
Attempted to preview the default Global Registration and Linux host_init_config as well as clones. Currently only one host is registered (aside from the foreman host itself) but neither host shows up in the list.
Hi, if I remember correctly, preview mode is enabled only for the managed hosts.
Your registered hosts are not managed by Foreman therefore they are not in the list.
Thinking about this it does make sense for the provisioning templates, but for the registration & host_init_config templates we should list un-managed hosts as well. I’ll look into it.
Yes, you are correct. As soon as I set it to managed, the host did show up but other errors appeared:
There was an error rendering the Global Registration clone template: undefined method '#login' for NilClass::Jail (NilClass)
It would make sense to have the ability to preview for unmanaged hosts otherwise it’s a lot of back-and-forth and resetting the host and foreman to test out changes and new steps for these templates.
Thanks for the help!
And PR  have been merged with following changes:
- Make Global registration template previewable
- Do not require host selection for registration templates
- Show managed & unmanaged hosts for host_init_config template preview
 Registration and host_init_config templates previews by stejskalleos · Pull Request #9033 · theforeman/foreman · GitHub