diff options
Diffstat (limited to 'manifests/interface.pp')
-rw-r--r-- | manifests/interface.pp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/manifests/interface.pp b/manifests/interface.pp index 1716a7e..403ee74 100644 --- a/manifests/interface.pp +++ b/manifests/interface.pp @@ -2,26 +2,28 @@ define shorewall::interface( $zone, $broadcast = 'detect', $options = 'tcpflags,blacklist,routefilter,nosmurfs,logmartians', + $add_options = '', $rfc1918 = false, $dhcp = false, $order = 100 ){ - 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" - } + $added_opts = $add_options ? { + '' => '', + default => ",${add_options}", + } + + $dhcp_opt = $dhcp ? { + false => '', + default => ',dhcp', + } + + $rfc1918_opt = $rfc1918 ? { + false => ',norfc1918', + default => '', } shorewall::entry { "interfaces-${order}-${name}": - line => "${zone} ${name} ${broadcast} ${options_real}", + line => "${zone} ${name} ${broadcast} ${options}${dhcp_opt}${rfc1918_opt}${added_opts}", } } |