summaryrefslogtreecommitdiff
path: root/manifests/zone.pp
blob: 8ee1b588300dd1741d2a3d71459f42747df11a6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# define a zone
define shorewall::zone(
  $type,
  $options = '-',
  $in      = '-',
  $out     = '-',
  $parent  = '-',
  $order   = 100,
){
  $real_name = $parent ? { '-' => $name, default => "${name}:${parent}" }
  shorewall::entry { "zones-${order}-${name}":
      line       => "${real_name} ${type} ${options} ${in} ${out}",
      shorewall  => true,
      shorewall6 => false,
  }
  if $shorewall::with_shorewall6 {
    $type6 = $type ? {
      'ipv4'  => 'ipv6',
      'ipsec' => 'ipsec6',
      'bport' => 'bport6',
      default => $type,
    }
    shorewall::entry { "zones-${order}-${name}_6":
      line       => "${real_name} ${type6} ${options} ${in} ${out}",
      shorewall  => false,
      shorewall6 => true,
    }
  }
}