init.pp 2.51 KB
Newer Older
mh's avatar
mh committed
1 2 3
class shorewall(
  $startup = '1'
) {
4

mh's avatar
mh committed
5
  case $::operatingsystem {
mh's avatar
mh committed
6
    gentoo: { include shorewall::gentoo }
7 8 9 10
    debian: {
      include shorewall::debian
      $dist_tor_user = 'debian-tor'
    }
mh's avatar
mh committed
11 12
    centos: { include shorewall::base }
    ubuntu: {
mh's avatar
mh committed
13
    case $::lsbdistcodename {
mh's avatar
mh committed
14 15 16
      karmic: { include shorewall::ubuntu::karmic }
      default: { include shorewall::debian }
      }
17
    }
mh's avatar
mh committed
18 19
    default: {
      notice "unknown operatingsystem: $operatingsystem" 
20
      include shorewall::base
mh's avatar
mh committed
21 22 23
    }
  }

24 25 26 27 28 29 30 31 32 33 34 35
  case $tor_transparent_proxy_host {
    '': { $tor_transparent_proxy_host = '127.0.0.1' }
  }
  case $tor_transparent_proxy_port {
    '': { $tor_transparent_proxy_port = '9040' }
  }
  if $tor_user == '' {
    $tor_user = $dist_tor_user ? {
      ''      => 'tor',
      default => $dist_tor_user,
    }
  }
36 37 38
  case $non_torified_users {
    '': { $non_torified_users = [] }
  }
Micah Anderson's avatar
Micah Anderson committed
39
  $real_non_torified_users = uniq_flatten($tor_user, $non_torified_users)
40

mh's avatar
mh committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
  # 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: }
mh's avatar
mh committed
63
  # See http://www.shorewall.net/3.0/Documentation.htm#Variables
mh's avatar
mh committed
64
  shorewall::managed_file { params: }
65
  # See http://www.shorewall.net/3.0/traffic_shaping.htm
66
  shorewall::managed_file { tcdevices: }
67
  # See http://www.shorewall.net/3.0/traffic_shaping.htm
68
  shorewall::managed_file { tcrules: }
69
  # See http://www.shorewall.net/3.0/traffic_shaping.htm
70
  shorewall::managed_file { tcclasses: }
71 72
  # http://www.shorewall.net/manpages/shorewall-providers.html
  shorewall::managed_file { providers: }
73
}