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:
parent
df0b3c0410
commit
cab5245c14
1 changed files with 9 additions and 0 deletions
|
@ -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 -%>
|
||||
|
|
Loading…
Reference in a new issue