Defined Type: firewall::client
- Defined in:
- modules/firewall/manifests/client.pp
Summary
a shim define to support a common interface between ferm::client and nft::clientOverview
SPDX-License-Identifier: Apache-2.0
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'modules/firewall/manifests/client.pp', line 12
define firewall::client(
$proto,
$port,
$ensure = present,
$desc = '',
$prio = 10,
$drange = undef,
$notrack = false,
$skip_output_chain = false,
$qos = '',
) {
include firewall
case $firewall::provider {
'none': {}
'ferm': {
ferm::client { $title:
* => wmflib::resource::dump_params(),
}
}
'nftables': {
if $drange =~ String {
fail('The drange needs to be passed as an array of hosts or IPs')
}
if $port =~ Pattern[/\d{1,5}:\d{1,5}/] {
fail('The port needs to be converted to use a port_range')
}
if $port =~ String {
fail('The port needs to be converted to an array; use a port or port_range')
}
nftables::client { $title:
* => wmflib::resource::filter_params('drange', 'srange'),
dst_ips => $drange.then |$range| { wmflib::hosts2ips($range) },
}
}
default: { fail('invalid provider') }
}
}
|