Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ADDED - Multisource hack

commit 212dfc6649ce6c2624a4bc8b330ccd98acaa6190 1 parent 7d37d6a
@glesperance authored
Showing with 36 additions and 0 deletions.
  1. +36 −0 manifests/multisource.pp
View
36 manifests/multisource.pp
@@ -0,0 +1,36 @@
+# firewall::multisource
+#
+# Hack to allow multiple firewall sources. It's very much in need of
+# expansion, but for now it will get the job done. (And if we ever get
+# multi-source-capable firewall, switch to that immediately!)
+#
+# Feel free to add more flags to pass through to the firewall flag.
+#
+# Usage:
+#
+# $cms = hiera_array('netrange_cms')
+# firewall::multisource { [ prefix($cms, '050 tftp,') ]:
+# action => 'accept',
+# proto => 'udp',
+# dport => '69',
+# }
+#
+define firewall::multisource (
+ $action = 'accept',
+ $dport = undef,
+ $sport = undef,
+ $port = undef,
+ $proto = undef,
+ $text = $title
+ ) {
+ $value = split ($title, ',')
+
+ firewall { "${value[0]} ${value[1]}":
+ action => $action,
+ dport => $dport,
+ sport => $sport,
+ proto => $proto,
+ port => $port,
+ source => $value[1]
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.