Commit 2f2345da authored by Ángel L. Mateo's avatar Ángel L. Mateo
Browse files

Fix huntgroups with array of conditions

Where there is more than one condition, then multiple huntgroup lines
should be created
parent 7dec3d81
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -8,13 +8,9 @@ define freeradius::huntgroup (
  $fr_basepath = $::freeradius::params::fr_basepath
  $fr_service  = $::freeradius::params::fr_service

  $conditionals = join($conditions, ', ')

  $content    = "${huntgroup}\t${conditionals}\n"

  concat::fragment { "huntgroup.${title}":
    target  => "${fr_basepath}/mods-config/preprocess/huntgroups",
    content => $content,
    content => template('freeradius/huntgroup.erb'),
    order   => $order,
    notify  => Service[$fr_service],
  }
+2 −6
Original line number Diff line number Diff line

#
##########################################################
# Huntgroup Puppet Name: <%= @name %>
#
<%- if @conditions.is_a?(Array) -%>
<%= @conditions.collect { |cond| @name + " " + cond }.join("\n") %>
<%= @conditions.collect { |cond| @huntgroup + " " + cond }.join("\n") %>
<%- else -%>
<%= @name %> <%= @conditions %>
<%= @huntgroup %> <%= @conditions %>
<%- end -%>