Révision 3a52fb41
Richer dport
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