Projet

Général

Profil

Révision 3a52fb41

ID3a52fb41aeb0adc8ad5680ea88bc2b8d4ccfc173
Parent fb65734d
Enfant 316bc3f8

Ajouté par Nacho Barrientos il y a plus de 4 ans

Richer dport

Voir les différences:

templates/simplerule.epp
1 1
<%- | String                  $action,
2 2
      Optional[String]        $comment,
3
      Optional[Integer]       $dport,
3
      Optional[Variant[Array[Stdlib::Port, 1], Stdlib::Port, String]] $dport,
4 4
      Optional[String]        $proto,
5 5
| -%>
6
<%- if $proto and $dport  {
7
  $_destination = "${proto} dport ${dport}"
6
<%- if $proto and $dport {
7
  if $dport =~ Array {
8
    $_destination = "${proto} dport {${dport.join(', ')}}"
9
  } else {
10
    $_destination = "${proto} dport $dport"
11
  }
8 12
} else {
9 13
  $_destination = undef
10 14
} -%>
......
13 17
} else {
14 18
  $_comment = undef
15 19
} -%>
16
<%= strip([$_destination, $_comment, $action].join(' ')) -%>
20
<%= regsubst(strip([$_destination, $_comment, $action].join(' ')), '\s+', ' ', 'G') -%>

Formats disponibles : Unified diff