aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-03-23 20:01:11 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-03-23 20:01:11 -0300
commitdffe0d74eadc7c25ab9ee513cb3a6b345dfa7644 (patch)
tree53e848d9d576687ec2c032564b6c42ba21b678f1 /manifests/init.pp
parent589f5723d500ad7325e19dfeb1d3b8450044acf1 (diff)
parentedd5db0159d5075609c545fb3ee10727a1cf5271 (diff)
downloadpuppet-shorewall-dffe0d74eadc7c25ab9ee513cb3a6b345dfa7644.tar.gz
puppet-shorewall-dffe0d74eadc7c25ab9ee513cb3a6b345dfa7644.tar.bz2
Merge remote-tracking branch 'shared/master' into developHEADmaster
Conflicts: manifests/tunnel.pp
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp158
1 files changed, 106 insertions, 52 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 5a7f740..d6b2d2a 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,3 +1,4 @@
+# Manage shorewall on your system
class shorewall(
$startup = '1',
$conf_source = false,
@@ -7,63 +8,116 @@ class shorewall(
$tor_user = $::operatingsystem ? {
'Debian' => 'debian-tor',
default => 'tor'
- }
+ },
+ $zones = {},
+ $zones_defaults = {},
+ $interfaces = {},
+ $interfaces_defaults = {},
+ $hosts = {},
+ $hosts_defaults = {},
+ $policy = {},
+ $policy_defaults = {},
+ $rules = {},
+ $rules_defaults = {},
+ $rulesections = {},
+ $rulesections_defaults = {},
+ $masq = {},
+ $masq_defaults = {},
+ $proxyarp = {},
+ $proxyarp_defaults = {},
+ $nat = {},
+ $nat_defaults = {},
+ $blacklist = {},
+ $blacklist_defaults = {},
+ $rfc1918 = {},
+ $rfc1918_defaults = {},
+ $routestopped = {},
+ $routestopped_defaults = {},
+ $params = {},
+ $params_defaults = {},
+ $tcdevices = {},
+ $tcdevices_defaults = {},
+ $tcrules = {},
+ $tcrules_defaults = {},
+ $tcclasses = {},
+ $tcclasses_defaults = {},
+ $tunnels = {},
+ $tunnels_defaults = {},
+ $rtrules = {},
+ $rtrules_defaults = {},
+ $daily_check = true,
) {
case $::operatingsystem {
- gentoo: { include shorewall::gentoo }
- debian: {
- include shorewall::debian
- $dist_tor_user = 'debian-tor'
- }
- centos: { include shorewall::base }
- ubuntu: {
- case $::lsbdistcodename {
- karmic: { include shorewall::ubuntu::karmic }
- default: { include shorewall::debian }
- }
- }
+ 'Gentoo': { include ::shorewall::gentoo }
+ 'Debian','Ubuntu': { include ::shorewall::debian }
+ 'CentOS': { include ::shorewall::centos }
default: {
- notice "unknown operatingsystem: ${::operatingsystem}"
- include shorewall::base
+ notice "unknown operatingsystem: ${::operatingsystem}"
+ include ::shorewall::base
}
}
- # See http://www.shorewall.net/3.0/Documentation.htm#Zones
- shorewall::managed_file{ zones: }
- # See http://www.shorewall.net/3.0/Documentation.htm#Interfaces
- shorewall::managed_file{ interfaces: }
- # See http://www.shorewall.net/3.0/Documentation.htm#Hosts
- shorewall::managed_file { hosts: }
- # See http://www.shorewall.net/3.0/Documentation.htm#Policy
- shorewall::managed_file { policy: }
- # See http://www.shorewall.net/3.0/Documentation.htm#Rules
- shorewall::managed_file { rules: }
- # See http://www.shorewall.net/3.0/Documentation.htm#Masq
- shorewall::managed_file{ masq: }
- # See http://www.shorewall.net/3.0/Documentation.htm#ProxyArp
- shorewall::managed_file { proxyarp: }
- # See http://www.shorewall.net/3.0/Documentation.htm#NAT
- shorewall::managed_file { nat: }
- # See http://www.shorewall.net/3.0/Documentation.htm#Blacklist
- shorewall::managed_file { blacklist: }
- # See http://www.shorewall.net/3.0/Documentation.htm#rfc1918
- shorewall::managed_file { rfc1918: }
- # See http://www.shorewall.net/3.0/Documentation.htm#Routestopped
- shorewall::managed_file { routestopped: }
- # See http://www.shorewall.net/3.0/Documentation.htm#Variables
- shorewall::managed_file { params: }
- # See http://www.shorewall.net/3.0/traffic_shaping.htm
- shorewall::managed_file { tcdevices: }
- # See http://www.shorewall.net/3.0/traffic_shaping.htm
- shorewall::managed_file { tcrules: }
- # See http://www.shorewall.net/3.0/traffic_shaping.htm
- shorewall::managed_file { tcclasses: }
- # http://www.shorewall.net/manpages/shorewall-providers.html
- shorewall::managed_file { providers: }
- # See http://www.shorewall.net/manpages/shorewall-tunnels.html
- shorewall::managed_file { tunnel: }
- # See http://www.shorewall.net/MultiISP.html
- shorewall::managed_file { rtrules: }
-
+ shorewall::managed_file{
+ [
+ # See http://www.shorewall.net/3.0/Documentation.htm#Zones
+ 'zones',
+ # See http://www.shorewall.net/3.0/Documentation.htm#Interfaces
+ 'interfaces',
+ # See http://www.shorewall.net/3.0/Documentation.htm#Hosts
+ 'hosts',
+ # See http://www.shorewall.net/3.0/Documentation.htm#Policy
+ 'policy',
+ # See http://www.shorewall.net/3.0/Documentation.htm#Rules
+ 'rules',
+ # See http://www.shorewall.net/3.0/Documentation.htm#Masq
+ 'masq',
+ # See http://www.shorewall.net/3.0/Documentation.htm#ProxyArp
+ 'proxyarp',
+ # See http://www.shorewall.net/3.0/Documentation.htm#NAT
+ 'nat',
+ # See http://www.shorewall.net/3.0/Documentation.htm#Blacklist
+ 'blacklist',
+ # See http://www.shorewall.net/3.0/Documentation.htm#rfc1918
+ 'rfc1918',
+ # See http://www.shorewall.net/3.0/Documentation.htm#Routestopped
+ 'routestopped',
+ # See http://www.shorewall.net/3.0/Documentation.htm#Variables
+ 'params',
+ # See http://www.shorewall.net/3.0/traffic_shaping.htm
+ 'tcdevices',
+ # See http://www.shorewall.net/3.0/traffic_shaping.htm
+ 'tcrules',
+ # See http://www.shorewall.net/3.0/traffic_shaping.htm
+ 'tcclasses',
+ # http://www.shorewall.net/manpages/shorewall-providers.html
+ 'providers',
+ # See http://www.shorewall.net/manpages/shorewall-tunnels.html
+ 'tunnel',
+ # See http://www.shorewall.net/MultiISP.html
+ 'rtrules',
+ # See http://www.shorewall.net/manpages/shorewall-mangle.html
+ 'mangle',
+ ]:;
+ }
+
+ create_resources('shorewall::zone',$zones,$zones_defaults)
+ create_resources('shorewall::interface',$interfaces,$interfaces_defaults)
+ create_resources('shorewall::host',$hosts,$hosts_defaults)
+ create_resources('shorewall::policy',$policy,$policy_defaults)
+ create_resources('shorewall::rule',$rules,$rules_defaults)
+ create_resources('shorewall::rule_section',$rulesections,$rulesections_defaults)
+ create_resources('shorewall::masq',$masq,$masq_defaults)
+ create_resources('shorewall::proxyarp',$proxyarp,$proxyarp_defaults)
+ create_resources('shorewall::nat',$nat,$nat_defaults)
+ create_resources('shorewall::blacklist',$blacklist,$blacklist_defaults)
+ create_resources('shorewall::rfc1918',$rfc1918,$rfc1918_defaults)
+ create_resources('shorewall::routestopped',$routestopped,
+ $routestopped_defaults)
+ create_resources('shorewall::params',$params,$params_defaults)
+ create_resources('shorewall::tcdevices',$tcdevices,$tcdevices_defaults)
+ create_resources('shorewall::tcrules',$tcrules,$tcrules_defaults)
+ create_resources('shorewall::tcclasses',$tcclasses,$tcclasses_defaults)
+ create_resources('shorewall::tunnel',$tunnels,$tunnels_defaults)
+ create_resources('shorewall::rtrules',$rtrules,$rtrules_defaults)
}