summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-09-22 17:49:07 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-09-22 17:49:07 -0300
commite079852d8dd6c965ed55ad660b03a452fb624fc3 (patch)
treea7f4e6abe296592d2729fb5b894367bb951c37a2
parent0d3bd204c75b2393495a5023ba7292a0a580dfc5 (diff)
downloadpuppet-firewall-e079852d8dd6c965ed55ad660b03a452fb624fc3.tar.gz
puppet-firewall-e079852d8dd6c965ed55ad660b03a452fb624fc3.tar.bz2
Parameters on firewall:ppp
-rw-r--r--manifests/ppp.pp53
1 files changed, 29 insertions, 24 deletions
diff --git a/manifests/ppp.pp b/manifests/ppp.pp
index 3082e92..e9ce789 100644
--- a/manifests/ppp.pp
+++ b/manifests/ppp.pp
@@ -1,31 +1,36 @@
-class firewall::ppp {
- shorewall::zone { 'ppp':
- type => 'ipv4',
- order => 4,
+class firewall::ppp(
+ $interface = 'ppp0',
+ $zone = 'ppp'
+) {
+ shorewall::interface { $interface:
+ zone => $zone,
}
- shorewall::interface { 'ppp0':
- zone => 'ppp',
- }
+ if $zone == 'ppp' {
+ shorewall::zone { 'ppp':
+ type => 'ipv4',
+ order => 4,
+ }
- shorewall::policy { 'loc-ppp':
- sourcezone => 'loc',
- destinationzone => 'ppp',
- policy => 'ACCEPT',
- order => 30,
- }
+ shorewall::policy { 'loc-ppp':
+ sourcezone => 'loc',
+ destinationzone => $zone,
+ policy => 'ACCEPT',
+ order => 30,
+ }
- shorewall::policy { 'ppp-loc':
- sourcezone => 'ppp',
- destinationzone => 'loc',
- policy => 'ACCEPT',
- order => 31,
- }
+ shorewall::policy { 'ppp-loc':
+ sourcezone => 'ppp',
+ destinationzone => $zone,
+ policy => 'ACCEPT',
+ order => 31,
+ }
- shorewall::policy { 'fw-ppp':
- sourcezone => '$FW',
- destinationzone => 'ppp',
- policy => 'ACCEPT',
- order => 32,
+ shorewall::policy { 'fw-ppp':
+ sourcezone => '$FW',
+ destinationzone => $zone,
+ policy => 'ACCEPT',
+ order => 32,
+ }
}
}