Commit 3691f9c0 authored by intrigeri's avatar intrigeri

Internal refactoring of shorewall::interface

... for more consistent options management.
The public API does not change.
parent ffbf9332
......@@ -7,28 +7,23 @@ define shorewall::interface(
$dhcp = false,
$order = 100
){
if $add_options == '' {
$added_options = ''
} else {
$added_options = ",${add_options}"
$added_opts = $add_options ? {
'' => '',
default => ",${add_options}",
}
if $rfc1918 {
if $dhcp {
$options_real = "${options},dhcp"
} else {
$options_real = "$options"
}
} else {
if $dhcp {
$options_real = "${options},norfc1918,dhcp"
} else {
$options_real = "${options},norfc1918"
}
$dhcp_opt = $dhcp ? {
false => '',
default => ',dhcp',
}
$rfc1918_opt = $rfc1918 ? {
false => ',norfc1918',
default => '',
}
shorewall::entry { "interfaces.d/${order}-${title}":
line => "${zone} ${name} ${broadcast} ${options_real}${added_options}",
line => "${zone} ${name} ${broadcast} ${options}${dhcp_opt}${rfc1918_opt}${added_opts}",
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment