Solução:
# Apache logging
<% if classes.include?("httpd") %>
local5.* @<%= scope.function_hiera(["ls_gelf_host"]) %>:<%= @service_port -%>
local5.info ~
local5.err ~
<% else %>
local5.info ~
local5.err ~
<% end %>
# Nginx logging
<% if classes.include?("nginx") %>
local4.* @<%= scope.function_hiera(["ls_gelf_host"]) %>:<%= @service_port -%>
local4.info ~
local4.err ~
<% else %>
local4.info ~
local4.err ~
<% end %>