object_host.conf.erb 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * WARNING: This host definition is automatically generated by Puppet.
  3. * ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN!
  4. */
  5. /**
  6. * A host definition. You can create your own configuration files
  7. * in the conf.d directory (e.g. one per host). By default all *.conf
  8. * files in this directory are included.
  9. *
  10. */
  11. object Host "<%= @object_hostname %>" {
  12. <%#- If any of the @ parameters are undefined, don't print anything for them: -%>
  13. <%- if @template_to_import -%>
  14. <%#- Otherwise, include the parameter: -%>
  15. import "<%= @template_to_import -%>"
  16. <%- end -%>
  17. <%- if @display_name -%>
  18. display_name = "<%= @display_name -%>"
  19. <%- end -%>
  20. <%- if @ipv4_address -%>
  21. address = "<%= @ipv4_address -%>"
  22. <%- end -%>
  23. <%- if @ipv6_address -%>
  24. address6 = "<%= @ipv6_address -%>"
  25. <%- end -%>
  26. <%- if @groups.length != 0 -%>
  27. groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>]
  28. <%- end -%>
  29. <%- if @vars.empty? != true -%>
  30. <%- @vars.sort_by {|key, value| key}.each do |key, value| -%>
  31. <%- if value.is_a?(Hash) -%>
  32. vars.<%= key %> = {
  33. <%- value.sort_by {|subkey,subvalue| subkey}.each do |subkey,subvalue| -%>
  34. <%= subkey %> = <%= subvalue %>
  35. <%- end -%>
  36. }
  37. <%- else -%>
  38. vars.<%= key %> = "<%= value %>"
  39. <%- end -%>
  40. <%- end -%>
  41. <%- end -%>
  42. <%- if @check_command -%>
  43. check_command = "<%= @check_command -%>"
  44. <%- end -%>
  45. <%- if @max_check_attempts -%>
  46. max_check_attempts = <%= @max_check_attempts %>
  47. <%- end -%>
  48. <%- if @check_period -%>
  49. check_period = <%= @check_period %>
  50. <%- end -%>
  51. <%- if @check_interval -%>
  52. check_interval = <%= @check_interval %>
  53. <%- end -%>
  54. <%- if @retry_interval -%>
  55. retry_interval = <%= @retry_interval %>
  56. <%- end -%>
  57. <%- if @enable_notifications -%>
  58. enable_notifications = <%= @enable_notifications %>
  59. <%- end -%>
  60. <%- if @enable_active_checks -%>
  61. enable_active_checks = <%= @enable_active_checks %>
  62. <%- end -%>
  63. <%- if @enable_passive_checks -%>
  64. enable_passive_checks = <%= @enable_passive_checks %>
  65. <%- end -%>
  66. <%- if @enable_event_handler -%>
  67. enable_event_handler = <%= @enable_event_handler %>
  68. <%- end -%>
  69. <%- if @enable_flapping -%>
  70. enable_flapping = <%= @enable_flapping %>
  71. <%- end -%>
  72. <%- if @enable_perfdata -%>
  73. enable_perfdata = <%= @enable_perfdata %>
  74. <%- end -%>
  75. <%- if @event_command -%>
  76. event_command = "<%= @event_command -%>"
  77. <%- end -%>
  78. <%- if @flapping_threshold -%>
  79. flapping_threshold = "<%= @flapping_threshold -%>"
  80. <%- end -%>
  81. <%- if @volatile -%>
  82. volatile = "<%= @volatile -%>"
  83. <%- end -%>
  84. <%- if @notes -%>
  85. notes = "<%= @notes -%>"
  86. <%- end -%>
  87. <%- if @notes_url -%>
  88. notes_url = "<%= @notes_url -%>"
  89. <%- end -%>
  90. <%- if @action_url -%>
  91. action_url = "<%= @action_url -%>"
  92. <%- end -%>
  93. <%- if @icon_image -%>
  94. icon_image = "<%= @icon_image -%>"
  95. <%- end -%>
  96. <%- if @icon_image_alt -%>
  97. icon_image_alt = "<%= @icon_image_alt -%>"
  98. <%- end -%>
  99. }