]> gitweb.fluxo.info Git - puppet-firewall.git/commitdiff
Misc fixes (2)
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 25 Jan 2022 16:29:40 +0000 (13:29 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 25 Jan 2022 16:29:40 +0000 (13:29 -0300)
manifests/implementations/shorewall/router/hairpinning.pp
manifests/implementations/shorewall/router/munin.pp
manifests/implementations/shorewall/router/ssh.pp
manifests/implementations/shorewall/router/tor.pp
manifests/router/hairpinning.pp
manifests/router/mail.pp
manifests/router/munin.pp
manifests/router/rsync.pp
manifests/router/ssh.pp
manifests/router/tor.pp
manifests/router/torrent.pp

index 21a8d9d5636913c284c83910ca0a9c092550038a..f78ebb4cc1d06a8519ad59a621bf02ccbcd38431 100644 (file)
@@ -1,5 +1,5 @@
 # See http://www.shorewall.net/FAQ.htm#faq2
-define firewall::router::hairpinning($order = '5000', $proto = 'tcp', $port = 'www',
+define firewall::implementations::shorewall::router::hairpinning($order = '5000', $proto = 'tcp', $port = 'www',
                                      $external_ip = '$ETH0_IP', $interface = 'eth1',
                                      $destination = '192.168.1.100', $source = 'eth1',
                                      $source_zone = 'loc', $dest_zone = 'loc',
index 7ca136d16541983b4699c9eb46aedcb417b3ed3c..698c12bfa1773589a1edbb14da723f3015793e33 100644 (file)
@@ -1,4 +1,4 @@
-define firewall::router::munin($destination, $port_orig, $port_dest = '', $zone = 'loc',
+define firewall::implementations::shorewall::router::munin($destination, $port_orig, $port_dest = '', $zone = 'loc',
                                $order = '400', $originaldest = $ipaddress) {
   shorewall::rule { "munin-$name-1":
     action          => 'DNAT',
index a37b61f24eac9455dc84b88d8ea98cb186770403..9bdf69e388a9d2d536d48d1c919c5490798b0a21 100644 (file)
@@ -1,4 +1,4 @@
-define firewall::router::ssh($destination, $port_orig = '22', $port_dest = '', $zone = 'loc',
+define firewall::implementations::shorewall::router::ssh($destination, $port_orig = '22', $port_dest = '', $zone = 'loc',
                              $originaldest = $ipaddress) {
   shorewall::rule { "ssh-$name-1":
     action          => 'DNAT',
index cf5cc58165d449f02f9de7da1580ba606af5900b..eae3775e9b9e782cc973048dfa805380c0d7edf1 100644 (file)
@@ -1,4 +1,4 @@
-define firewall::router::tor($destination, $zone = 'loc', $originaldest = $ipaddress) {
+define firewall::implementations::shorewall::router::tor($destination, $zone = 'loc', $originaldest = $ipaddress) {
   shorewall::rule { "tor-$name-1":
     action          => 'DNAT',
     source          => 'net',
index 96fac1e9ba5b4863b80240ee337619ab5fd92a40..7be71ca3514a9f00412b5d566e30cc4777899958 100644 (file)
@@ -12,16 +12,18 @@ define firewall::router::hairpinning(
   $dest_zone      = 'loc',
   $port_dest      = ''
 ) {
-  class { "firewall::implementations::${implementation}::router::hairpinning":
-    order       => $order,
-    proto       => $proto,
-    port        => $port,
-    external_ip => $external_ip,
-    interface   => $interface,
-    destination => $destination,
-    source      => $source,
-    source_zone => $source_zone,
-    dest_zone   => $dest_zone,
-    port_dest   => $port_dest,
+  if $implementation == 'shorewall' {
+    firewall::implementations::shorewall::router::hairpinning { "${name}":
+      order       => $order,
+      proto       => $proto,
+      port        => $port,
+      external_ip => $external_ip,
+      interface   => $interface,
+      destination => $destination,
+      source      => $source,
+      source_zone => $source_zone,
+      dest_zone   => $dest_zone,
+      port_dest   => $port_dest,
+    }
   }
 }
index 5efde58a443754743c8babd29b0558bccb4c15c6..6ae56627b7766d760bdedd25e0f96cb290cdab8c 100644 (file)
@@ -1,4 +1,4 @@
-class firewall::router::mail(i
+class firewall::router::mail(
   $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
   $destination, $zone = 'loc', $originaldest = $ipaddress
 ) {
index 4fd33fd4ca974abc2129ab2ff2b7c46a39c94fa4..e5d2fb92eb72b044785670461ec83bfaf4fa7bf6 100644 (file)
@@ -7,12 +7,14 @@ define firewall::router::munin(
    $originaldest   = $ipaddress
    $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
 ) {
-  class { "firewall::implementations::${implementation}::router::munin":
-    destination  => $destination,
-    port_orig    => $port_orig,
-    port_dest    => $port_dest,
-    zone         => $zone,
-    order        => $order,
-    originaldest => $originaldest,
+  if $implementation == 'shorewall' {
+    firewall::implementations::shorewall::router::munin { "${name}":
+      destination  => $destination,
+      port_orig    => $port_orig,
+      port_dest    => $port_dest,
+      zone         => $zone,
+      order        => $order,
+      originaldest => $originaldest,
+    }
   }
 }
index 9e36f85a212bcecd2390907f177571af6dac9b94..8098e4ad69b1fdf6606f5d2d0b33aa321ae02df6 100644 (file)
@@ -3,7 +3,7 @@ class firewall::router::rsync(
    $port_orig     = '873',
    $port_dest     = '',
    $zone          = 'loc',
-   $originaldest  = $ipaddress
+   $originaldest  = $ipaddress,
    $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
 ) {
   class { "firewall::implementations::${implementation}::router::rsync":
@@ -11,7 +11,6 @@ class firewall::router::rsync(
     port_orig    => $port_orig,
     port_dest    => $port_dest,
     zone         => $zone,
-    order        => $order,
     originaldest => $originaldest,
   }
 }
index 6f1a640ce9bba18435a02898f1911d163d11ad9f..5704fbb60623ccc2af9219bebeb1b7df9af1c012 100644 (file)
@@ -6,12 +6,13 @@ define firewall::router::ssh(
   $originaldest   = $ipaddress,
   $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
 ) {
-  class { "firewall::implementations::${implementation}::router::ssh":
-    destination  => $destination,
-    port_orig    => $port_orig,
-    port_dest    => $port_dest,
-    zone         => $zone,
-    order        => $order,
-    originaldest => $originaldest,
+  if $implementation == 'shorewall' {
+    firewall::implementations::shorewall::router::ssh { "${name}":
+      destination  => $destination,
+      port_orig    => $port_orig,
+      port_dest    => $port_dest,
+      zone         => $zone,
+      originaldest => $originaldest,
+    }
   }
 }
index b93ea05ec4baa902765fb7c4f4c248d87c90453e..e3c61fb36295f82a4f081f7a23a0ae5137428902 100644 (file)
@@ -2,9 +2,11 @@ define firewall::router::tor(
   $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
   $destination, $zone = 'loc', $originaldest = $ipaddress
 ) {
-  class { "firewall::implementations::${implementation}::router::tor":
-    destination  => $destination,
-    zone         => $zone,
-    originaldest => $originaldest,
+  if $implementation == 'shorewall' {
+    firewall::implementations::shorewall::router::tor { "${name}":
+      destination  => $destination,
+      zone         => $zone,
+      originaldest => $originaldest,
+    }
   }
 }
index b5ac97d2c44553faa00303292958939d5d75c751..493bd4c6e974fe935e1d6ae58270fed6efd7f52d 100644 (file)
@@ -2,7 +2,7 @@ class firewall::router::torrent(
   $destination,
   $zone           = 'loc',
   $originaldest   = $ipaddress,
-  $range          = lookup('firewall::torrent::range', undef, undef, '6881:6999')
+  $range          = lookup('firewall::torrent::range', undef, undef, '6881:6999'),
   $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
 ) {
   class { "firewall::implementations::${implementation}::router::torrent":