]> gitweb.fluxo.info Git - puppet-firewall.git/commitdiff
Misc fixes
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 25 Jan 2022 16:00:48 +0000 (13:00 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 25 Jan 2022 16:00:48 +0000 (13:00 -0300)
manifests/implementations/shorewall/virtual/munin.pp
manifests/implementations/shorewall/virtual/ssh.pp
manifests/implementations/shorewall/virtual/web.pp
manifests/redirect.pp
manifests/virtual/munin.pp
manifests/virtual/ssh.pp
manifests/virtual/web.pp

index 79514c61836f70c285b1ab0b8d0685aee72c3b5f..662d6d5b7473420c6efdcdb98d7b1cf24922124b 100644 (file)
@@ -1,4 +1,4 @@
-define firewall::virtual::munin($destination, $port_orig, $port_dest = '', $order = '400', $zone = 'fw') {
+define firewall::implementations::shorewall::virtual::munin($destination, $port_orig, $port_dest = '', $order = '400', $zone = 'fw') {
   shorewall::rule { "munin-$name-1":
     action          => 'DNAT',
     source          => 'net',
index 7ad93fce139e990aa00a3cfb5158c963d5db779a..d873cd90191d8c427d447d1d91ef8a3b07b59142 100644 (file)
@@ -1,4 +1,4 @@
-define firewall::virtual::ssh($destination, $port_orig = '22', $port_dest = '', $zone = 'vm') {
+define firewall::implementations::shorewall::virtual::ssh($destination, $port_orig = '22', $port_dest = '', $zone = 'vm') {
   shorewall::rule { "ssh-$name-1":
     action          => 'DNAT',
     source          => 'net',
index 06bf993ad4997e211c2dd838c1b79802128e2c68..13e6831170826c7c5e2a4f4755242560eb8e32de 100644 (file)
@@ -1,4 +1,4 @@
-define firewall::virtual::web(
+define firewall::implementations::shorewall::virtual::web(
   $destination
 ) {
   shorewall::rule { "web-route-${name}-1":
index de50f86389dd9e3431a3f88e480413c403b898ed..f6e8ad538a9e38e9dd020e69f4cc3543bdf99e57 100644 (file)
@@ -3,6 +3,6 @@ class firewall::redirect::ssh(
   $destinationport,
 ) {
   class { "firewall::implementations::${implementation}::redirect::ssh":
-    destinationport = $destinationport,
+    destinationport => $destinationport,
   }
 }
index 531acd9ed920e9de5d84698dc5131305e577e1a1..3db8b7e0603e20ad3595a3845b8b3c498a675b6e 100644 (file)
@@ -6,11 +6,13 @@ define firewall::virtual::munin(
   $zone           = 'fw'
   $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
 ) {
-  class { "firewall::implementations::${implementation}::virtual::munin":
-    destination => $destination,
-    port_orig   => $port_orig,
-    port_dest   => $port_dest,
-    order       => $order,
-    zone        => $zone,
+  if $implementation == 'shorewall' {
+    firewall::implementations::shorewall::virtual::munin { "${name}":
+      destination => $destination,
+      port_orig   => $port_orig,
+      port_dest   => $port_dest,
+      order       => $order,
+      zone        => $zone,
+    }
   }
 }
index 0a11fa2c4843195b8cd041ebbcf9c3e064d9db02..98fa976c79ed9ea2a52a699653ef56c3f76df331 100644 (file)
@@ -2,13 +2,15 @@ define firewall::virtual::ssh(
   $destination,
   $port_orig      = '22',
   $port_dest      = '',
-  $zone           = 'vm'
+  $zone           = 'vm',
   $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
 ) {
-  class { "firewall::implementations::${implementation}::virtual::ssh":
-    destination => $destination,
-    port_orig   => $port_orig,
-    port_dest   => $port_dest,
-    zone        => $zone,
+  if $implementation == 'shorewall' {
+    firewall::implementations::shorewall::virtual::ssh { "${name}":
+      destination => $destination,
+      port_orig   => $port_orig,
+      port_dest   => $port_dest,
+      zone        => $zone,
+    }
   }
 }
index c54a95bce3b1b3a8624728d503bd3d1bf72d58fc..d551d4bdb6b2e5539d1e8435248d047514f15bd6 100644 (file)
@@ -2,7 +2,9 @@ define firewall::virtual::web(
   $implementation = lookup('firewall::implementation', undef, undef, 'shorewall'),
   $destination
 ) {
-  class { "firewall::implementations::${implementation}::virtual::web":
-    destination => $destination,
+  if $implementation == 'shorewall' {
+    firewall::implementations::shorewall::virtual::web { "${name}":
+      destination => $destination,
+    }
   }
 }