When using report templates - how does one return the environment?
Without safemode - host.environment.to_s works great
With safemode - that is “jailed”. There is no evidently named “environment” method on the host class (from the Report Help Tab)
With normal ERB snippets - i have no problem doing:
However within a very simplified report:
<%- load_hosts(search: input(‘hosts’)).each_record do |host| -%>
‘Host FQDN’: host.name.to_s,
I am given the error: There was an error rendering the TEST Patching template: undefined local variable or method
host_puppet_environment' for #<Foreman::Renderer::Scope::Report:0x00007fbafaeffad0> Did you mean? host_puppet_classes Similarly trying with something like host.host_puppet_environment.name returns: There was an error rendering the TEST Patching template: undefined method host_puppet_environment’ for #Host::Managed:0x000055a362367760 Did you mean? hosts_api_ansible_inventories_path
How do i return a host’s “Environment” when utilizing Safe Mode in a Report Template?
Foreman and Proxy versions:
Foreman and Proxy plugin versions:
Foreman 3.0.1 Equivalents
Distribution and version: