Icinga / puppet-icinga2-legacy

(legacy) Puppet module for Icinga 2 (EOL)
GNU General Public License v2.0
55 stars 93 forks source link

[dev.icinga.com #11326] Create vars += config entry #345

Open icinga-migration opened 8 years ago

icinga-migration commented 8 years ago

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11326

Created by pregopresto on 2016-03-07 21:46:58 +00:00

Assignee: (none) Status: New Target Version: (none) Last Update: 2016-03-12 22:19:19 +00:00 (in Redmine)


After successful implementation of #9107 I can not see how to create a vars += config entry using the puppet module anymore. Can this be implemented again?

icinga-migration commented 8 years ago

Updated by pregopresto on 2016-03-07 22:18:09 +00:00

Note: I achieved this with modifying the apply_service template as follows:

  <%- if @vars.empty? != true -%>
  <%- if @vars.is_a?(Hash) -%>
  vars += <%= scope.function_icinga2_config_value([@vars]) %>
  <%- else -%>
  vars += <%= @vars %>
  <%- end -%>
  <%- end -%>

and I removed the validate_hash($vars) from the apply_service.pp but there must be prettier ways...

icinga-migration commented 8 years ago

Updated by pregopresto on 2016-03-12 22:19:19 +00:00

same for users and user_group entries at apply_notification_to_*, just Array instead of Hash and not += but = but the change should be the same.