root / templates / simplerule.epp @ 3a52fb41
Historique | Voir | Annoter | Télécharger (588 octets)
1 | 83382bb5 | Nacho Barrientos | <%- | String $action, |
---|---|---|---|
2 | Optional[String] $comment, |
||
3 | 3a52fb41 | Nacho Barrientos | Optional[Variant[Array[Stdlib::Port, 1], Stdlib::Port, String]] $dport, |
4 | 83382bb5 | Nacho Barrientos | Optional[String] $proto, |
5 | | -%> |
||
6 | 3a52fb41 | Nacho Barrientos | <%- if $proto and $dport { |
7 | if $dport =~ Array { |
||
8 | $_destination = "${proto} dport {${dport.join(', ')}}" |
||
9 | } else { |
||
10 | $_destination = "${proto} dport $dport" |
||
11 | } |
||
12 | 83382bb5 | Nacho Barrientos | } else { |
13 | $_destination = undef |
||
14 | } -%> |
||
15 | <%- if $comment { |
||
16 | $_comment = "comment \"${comment}\"" |
||
17 | } else { |
||
18 | $_comment = undef |
||
19 | } -%> |
||
20 | 3a52fb41 | Nacho Barrientos | <%= regsubst(strip([$_destination, $_comment, $action].join(' ')), '\s+', ' ', 'G') -%> |