object_eventcommand.conf.erb 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * WARNING: This EventCommand definition is automatically generated by Puppet.
  3. * ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN!
  4. */
  5. /**
  6. * A EventCommand definition. You can create your own configuration files
  7. * in the conf.d directory (e.g. one per commnand). By default all *.conf
  8. * files in this directory are included.
  9. *
  10. */
  11. object EventCommand "<%= @object_eventcommandname %>" {
  12. <%#- If any of the @ parameters are undefined, don't print anything for them: -%>
  13. <%- if @template_to_import -%>
  14. import "<%= @template_to_import -%>"
  15. <%- end -%>
  16. <%- if @command -%>
  17. command = [ <% if @cmd_path -%><%= @cmd_path -%> + <% end -%><% @command.each_with_index do |cmd, i| %><%= cmd -%><%= ', ' if i < (@command.size - 1) %><% end %> ]
  18. <%- end -%>
  19. <%#- Need to add support to argument value as hash (recursivity) -%>
  20. <%- if @arguments.empty? != true -%>
  21. arguments = {
  22. <%- @arguments.each_with_index do |(key,value), i| -%>
  23. <%= key %> = <% if value.class == String %><%= value %>
  24. <%- else -%>{
  25. <%- value.sort_by {|k, v| k}.each do |k, v| -%>
  26. <%= k %> = <%= v %>
  27. <%- end -%>
  28. }
  29. <%- end -%>
  30. <%- end -%>
  31. }
  32. <%- end -%>
  33. <%- if @vars.empty? -%>
  34. <%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
  35. <%= key %> = <% if value.class == String %><%= value %>
  36. <%- else -%>{
  37. <%- value.sort_by {|k, v| k}.each do |k, v| -%>
  38. <%= k %> = <%= v %>
  39. <%- end -%>
  40. }
  41. <%- end -%>
  42. <%- end -%>
  43. <%- end -%>
  44. <%- if @timeout -%>
  45. timeout = <%= @timeout %>
  46. <%- end -%>
  47. <%- if @env.empty? != true -%>
  48. env = {
  49. <%- @env.sort_by {|key, value| key}.each do |key, value| -%>
  50. <%= key %> = <%= value %>
  51. <%- end -%>
  52. }
  53. <%- end -%>
  54. }