diff options
author | mh <mh@immerda.ch> | 2013-06-15 15:27:01 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-06-15 15:27:01 +0200 |
commit | e7d7e686ccaa6af5e1666e98204699d70e1ebd2f (patch) | |
tree | 280b09cbadeb2fe2de163112bc2f64d1fce651d0 | |
parent | 4c613d6cd4ffd724bacd45e776efe3e6a082baa4 (diff) | |
parent | 06c5058752f7c1856380766784f48e077c3194ed (diff) |
Merge remote-tracking branch 'shared/master'
-rw-r--r-- | manifests/rtrules.pp | 2 | ||||
-rw-r--r-- | manifests/rules/libvirt/host.pp | 50 | ||||
-rw-r--r-- | manifests/tunnel.pp | 2 |
3 files changed, 38 insertions, 16 deletions
diff --git a/manifests/rtrules.pp b/manifests/rtrules.pp index 34e12b4..3810f26 100644 --- a/manifests/rtrules.pp +++ b/manifests/rtrules.pp @@ -5,7 +5,7 @@ define shorewall::rtrules( $priority = '10000', $mark, ){ - shorewall::entry { "rtrules.d/${mark}-${title}": + shorewall::entry { "rtrules-${mark}-${name}": line => "# ${name}\n${source} ${destination} ${provider} ${priority} ${mark}", } } diff --git a/manifests/rules/libvirt/host.pp b/manifests/rules/libvirt/host.pp index aaecd9d..dfb753c 100644 --- a/manifests/rules/libvirt/host.pp +++ b/manifests/rules/libvirt/host.pp @@ -1,13 +1,21 @@ class shorewall::rules::libvirt::host ( - $vmz = 'vmz', - $masq_iface = 'eth0', + $vmz = 'vmz', + $masq_iface = 'eth0', + $debproxy_port = 8000, ) { define shorewall::rule::accept::from_vmz ( - $proto = '-', $destinationport = '-', $action = 'ACCEPT' ) { - shorewall::rule { "$name": - source => $vmz, destination => '$FW', order => 300, - proto => $proto, destinationport => $destinationport, action => $action; + $proto = '-', + $destinationport = '-', + $action = 'ACCEPT' + ) { + shorewall::rule { $name: + source => $shorewall::rules::libvirt::host::vmz, + destination => '$FW', + order => 300, + proto => $proto, + destinationport => $destinationport, + action => $action; } } @@ -31,16 +39,30 @@ class shorewall::rules::libvirt::host ( } shorewall::rule::accept::from_vmz { - 'accept_dns_from_vmz': action => 'DNS(ACCEPT)'; - 'accept_tftp_from_vmz': action => 'TFTP(ACCEPT)'; - 'accept_debproxy_from_vmz': proto => 'tcp', destinationport => '8000', action => 'ACCEPT'; - 'accept_puppet_from_vmz': proto => 'tcp', destinationport => '8140', action => 'ACCEPT'; + 'accept_dns_from_vmz': + action => 'DNS(ACCEPT)'; + 'accept_tftp_from_vmz': + action => 'TFTP(ACCEPT)'; + 'accept_puppet_from_vmz': + proto => 'tcp', + destinationport => '8140', + action => 'ACCEPT'; } - shorewall::masq { - "masq-${masq_iface}": - interface => "$masq_iface", - source => '10.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.168.0.0/16'; + if $debproxy_port { + shorewall::rule::accept::from_vmz { 'accept_debproxy_from_vmz': + proto => 'tcp', + destinationport => $debproxy_port, + action => 'ACCEPT'; + } + } + + if $masq_iface { + shorewall::masq { + "masq-${masq_iface}": + interface => $masq_iface, + source => '10.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.168.0.0/16'; + } } } diff --git a/manifests/tunnel.pp b/manifests/tunnel.pp index e0c71e7..2cac922 100644 --- a/manifests/tunnel.pp +++ b/manifests/tunnel.pp @@ -5,7 +5,7 @@ define shorewall::tunnel( $gateway_zones = '', $order = '1' ) { - shorewall::entry { "tunnel.d/${order}-${title}": + shorewall::entry { "tunnel-${order}-${name}": line => "# ${name}\n${tunnel_type} ${zone} ${gateway} ${gateway_zones}", } } |