Trying to set a variable to host_param('medium')

I’m trying to set a variable in a template to the specific version on the OS I want to provision. This variable is concatenated with a string to create a path to the kernel.

Expecting a string to be equal to the Media field in the Operating System tab under the host or the hostgroup. Instead, I get an empty string.

Foreman and Proxy versions:
1.17.1 Discovery

This line always defaults to 1.6.65
version = “#{host_param(‘medium’) || ‘1.6.65’}”

This line results in an empty string.
version = host_param(‘medium’)

Just for testing purposes, is there a way to have a template dump out the keys available in host_param?

What you are looking for is @host.medium, or possibly the macro media_path (though i’m not sure if it was already available in 1.17 or if it is a newer addition). You can see all available attributes and macros on the help tab when editing the template. host_param is used to access the host parameters - which you can see on the Parameters tab under the “Global Parameters” and “Host Parameters” headers when editing the host.

You should also keep in mind that 1.17 is long out of support and no longer receives any security or other updates - I highly recommend planning your upgrade to a more recent release, such as 1.22.