If I use this I got the error
<% if @host.location.to_s =~ /^DE/ -%>
There was an error rendering the KN Kickstart Default template: Safemode
doesn't allow to access 'match3' on @host.to_jail.location.to_jail.to_s =~
/^DE/
and for this
<% if @host.location.to_s =~ "DE.*" -%>
There was an error rendering the KN Kickstart Default template: undefined
method '=~' for String::Jail (String)
and <% if @host.location.to_s == "DE*" -%>
doesn't work
Could you help me!.
Should this work?
I'm using Foreman 1.3 on CentOS 6.4
Locations and Organizations is configuerd and enabled
regular expressions are considered to be unsafe, therefore you need to turn off “safe mode” in the Administer - Settings and it will work then. Beware that now any operator can put “Kernel.exit(0)” into a template which will cause the Foreman server to stop from now on.