Skip to content

Commit 6953eb6

Browse files
committed
Allowing all from some addresses
1 parent 1e1f396 commit 6953eb6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

manifests/init.pp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class dofirewall {
1+
class dofirewall (
2+
$allow_all_from = [],
3+
) {
4+
25
include dofirewall::pre
36
include dofirewall::post
47
include firewall
@@ -20,7 +23,19 @@
2023

2124
Firewall <<| |>>
2225

23-
firewall { "101 accept ssh from anywhere":
26+
define allow_all_from {
27+
firewall { "101 accept all from $title":
28+
proto => 'all',
29+
action => 'accept',
30+
source => $title,
31+
}
32+
}
33+
34+
if ($allow_all_from) {
35+
allow_all_from { $allow_all_from: }
36+
}
37+
38+
firewall { "102 accept ssh from anywhere":
2439
proto => 'tcp',
2540
port => 22,
2641
action => 'accept',

0 commit comments

Comments
 (0)