Update object_host.conf.erb

Added routine for cases where the value of a vars variable is a hash.

Merged from: https://github.com/Icinga/puppet-icinga2/pull/58

refs#8156: https://dev.icinga.org/issues/8156
This commit is contained in:
Nicolas Bigler 2014-11-25 19:07:12 +01:00 committed by Nick Chappell
parent df0b3c0410
commit cab5245c14

View file

@ -30,9 +30,18 @@ object Host "<%= @object_hostname %>" {
<%- end -%>
<%- if @vars.empty? != true -%>
<%- @vars.each_pair do |key, value| -%>
<%- @vars.each_pair do |key,value| -%>
<%- if value.is_a?(Hash) -%>
vars.<%= key %> = {
<%- value.each_pair do |subkey,subvalue|-%>
<%= subkey %> = <%= subvalue %>
<%- end -%>
}
<%- else -%>
vars.<%= key %> = "<%= value %>"
<%- end -%>
<%- end -%>
<%- end -%>
<%- if @check_command -%>
check_command = "<%= @check_command -%>"
<%- end -%>