d55c055682
Signed-off-by: Nick Chappell <nick@intronic.org> Merged in from: https://github.com/Icinga/puppet-icinga2/pull/32 refs#7228: https://dev.icinga.org/issues/7228
62 líneas
1,6 KiB
Text
62 líneas
1,6 KiB
Text
/**
|
|
* WARNING: This NotificationCommand definition is automatically generated by Puppet.
|
|
* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN!
|
|
*/
|
|
|
|
/**
|
|
* A NotificationCommand definition. You can create your own configuration files
|
|
* in the conf.d directory (e.g. one per commnand). By default all *.conf
|
|
* files in this directory are included.
|
|
*
|
|
*/
|
|
|
|
object NotificationCommand "<%= @object_notificationcommandname %>" {
|
|
<%#- If any of the @ parameters are undefined, don't print anything for them: -%>
|
|
|
|
<%- if @template_to_import -%>
|
|
import "<%= @template_to_import -%>"
|
|
<%- end -%>
|
|
<%- if @command -%>
|
|
|
|
command = [ <% if @cmd_path -%><%= @cmd_path -%> + <% end -%><% @command.each_with_index do |cmd, i| %><%= cmd -%><%= ', ' if i < (@command.size - 1) %><% end %> ]
|
|
<%- end -%>
|
|
<%#- Need to add support to argument value as hash (recursivity) -%>
|
|
<%- if @arguments.empty? != true -%>
|
|
|
|
arguments = {
|
|
<%- @arguments.each_with_index do |(key,value), i| -%>
|
|
<%= key %> = <% if value.class == String %><%= value %>
|
|
<%- else -%>{
|
|
<%- value.each_pair do |k,v| -%>
|
|
<%= k %> = <%= v %>
|
|
<%- end -%>
|
|
}
|
|
<%- end -%>
|
|
<%- end -%>
|
|
}
|
|
<%- end -%>
|
|
<%- if @vars.empty? != true -%>
|
|
|
|
<%- @vars.each_pair do |key,value| -%>
|
|
<%= key %> = <% if value.class == String %><%= value %>
|
|
<%- else -%>{
|
|
<%- value.each_pair do |k,v| -%>
|
|
<%= k %> = <%= v %>
|
|
<%- end -%>
|
|
}
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- if @timeout -%>
|
|
|
|
timeout = <%= @timeout %>
|
|
<%- end -%>
|
|
<%- if @env.empty? != true -%>
|
|
|
|
env = {
|
|
<%- @env.each_pair do |key,value| -%>
|
|
<%= key %> = <%= value %>
|
|
<%- end -%>
|
|
}
|
|
<%- end -%>
|
|
}
|