Skip to content

Commit 76f8588

Browse files
committed
Allow all on given ports
1 parent c5a7107 commit 76f8588

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

manifests/init.pp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class dofirewall (
22
$allow_all_from = [],
3+
$allow_ports = [],
34
) {
45

56
include dofirewall::pre
@@ -35,9 +36,15 @@
3536
allow_all_from { $allow_all_from: }
3637
}
3738

38-
firewall { "102 accept ssh from anywhere":
39-
proto => 'tcp',
40-
port => 22,
41-
action => 'accept',
39+
define allow_ports {
40+
firewall { "102 accept all on port $title":
41+
proto => 'all',
42+
port => $title,
43+
action => 'accept',
44+
}
45+
}
46+
47+
if ($allow_ports) {
48+
allow_ports { $allow_ports: }
4249
}
4350
}

0 commit comments

Comments
 (0)