hiera dealing with undefined variables in erb templates
I start using hiera for environment or machine specific variables but I am facing an issue when variable is not found nowhere. Desired behaviour is that shouldn't be included into template. I did following: In my manifest code
and in erb template I have:
<% if !@yarn_app_mapreduce_am_command_opts.nil? %> <property> <name>yarn.app.mapreduce.am.command-opts</name> <value><%= @yarn_app_mapreduce_am_command_opts %></value> </property> <%end %>
According to the documentation here safest is to test on nil. I tried several variants but non of them worked.
Could someone help?