From 32c97619505a28d6f9838d9ebc109f472687fe4f Mon Sep 17 00:00:00 2001 From: Marknl Date: Tue, 10 Jan 2017 11:21:20 +0100 Subject: Added $host option Current rule.pp converts the $name into the "HOST" parameter in the file, this can result in these definitions: ```shorewall::host { 'eth0:$VPN_HOSTS': zone => 'vpn', options => 'ipsec', order => 200; }``` I suggest moving the variable usage from the $name into a $host parameter, so above example becomes: ```shorewall::host { 'vpn-hosts': zone => 'vpn', host => 'eth0:$VPN_HOSTS', options => 'ipsec', order => 200; }``` --- manifests/host.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'manifests/host.pp') diff --git a/manifests/host.pp b/manifests/host.pp index f400223..2510ca7 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -1,10 +1,11 @@ define shorewall::host( $zone, + $host, $options = 'tcpflags,blacklist,norfc1918', $order='100' ){ shorewall::entry{"hosts-${order}-${name}": - line => "${zone} ${name} ${options}" + line => "#${name}\n${zone} ${host} ${options}" } } -- cgit v1.2.3 From a7b138d73ea419afa82c83d1b4d607a5a5d5ddee Mon Sep 17 00:00:00 2001 From: Marknl Date: Wed, 11 Jan 2017 22:52:36 +0100 Subject: Brought $name back into the game for backw. compat --- manifests/host.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'manifests/host.pp') diff --git a/manifests/host.pp b/manifests/host.pp index 2510ca7..1bd56cc 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -1,11 +1,15 @@ define shorewall::host( $zone, - $host, + $host = undef, $options = 'tcpflags,blacklist,norfc1918', - $order='100' + $order ='100' ){ + + unless $host == undef { + $host = $name + } + shorewall::entry{"hosts-${order}-${name}": line => "#${name}\n${zone} ${host} ${options}" } } - -- cgit v1.2.3 From c868850e3161c69d01b7caf05192d625fc1df0c1 Mon Sep 17 00:00:00 2001 From: Marknl Date: Thu, 12 Jan 2017 13:17:21 +0100 Subject: Use $name for backwards compatibility --- manifests/host.pp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'manifests/host.pp') diff --git a/manifests/host.pp b/manifests/host.pp index 1bd56cc..d2a73ce 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -1,13 +1,9 @@ define shorewall::host( $zone, - $host = undef, + $host = $name, $options = 'tcpflags,blacklist,norfc1918', $order ='100' ){ - - unless $host == undef { - $host = $name - } shorewall::entry{"hosts-${order}-${name}": line => "#${name}\n${zone} ${host} ${options}" -- cgit v1.2.3