aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-01-02 19:15:34 +0100
committermh <mh@immerda.ch>2013-01-02 19:15:34 +0100
commit2f388687ea30fdefdcd405807a0fce699807809d (patch)
tree5d0449c901db61f753b6aa30b7c1d29fe0a0070b
parent5e555243c8dd93f7e5cfadacc9c3843d5f9d421c (diff)
parentc566c907a31b8142b2f2570210b9547c22af5326 (diff)
downloadpuppet-shorewall-2f388687ea30fdefdcd405807a0fce699807809d.tar.gz
puppet-shorewall-2f388687ea30fdefdcd405807a0fce699807809d.tar.bz2
Merge remote-tracking branch 'sarava/master'
Conflicts: manifests/base.pp manifests/init.pp
-rw-r--r--files/boilerplate/tunnel.footer1
-rw-r--r--files/boilerplate/tunnel.header11
-rw-r--r--manifests/base.pp3
-rw-r--r--manifests/init.pp25
-rw-r--r--manifests/tunnel.pp11
5 files changed, 36 insertions, 15 deletions
diff --git a/files/boilerplate/tunnel.footer b/files/boilerplate/tunnel.footer
new file mode 100644
index 0000000..5e12d1d
--- /dev/null
+++ b/files/boilerplate/tunnel.footer
@@ -0,0 +1 @@
+#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
diff --git a/files/boilerplate/tunnel.header b/files/boilerplate/tunnel.header
new file mode 100644
index 0000000..638fd56
--- /dev/null
+++ b/files/boilerplate/tunnel.header
@@ -0,0 +1,11 @@
+#
+# Shorewall version 4 - Tunnels File
+#
+# For information about entries in this file, type "man shorewall-tunnels"
+#
+# The manpage is also online at
+# http://www.shorewall.net/manpages/shorewall-tunnels.html
+#
+###############################################################################
+#TYPE ZONE GATEWAY GATEWAY
+# ZONE
diff --git a/manifests/base.pp b/manifests/base.pp
index 937b83b..97f94f5 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,6 +1,7 @@
class shorewall::base {
+
package { 'shorewall':
- ensure => $shorewall_ensure_version,
+ ensure => $shorewall::ensure_version,
}
# This file has to be managed in place, so shorewall can find it
diff --git a/manifests/init.pp b/manifests/init.pp
index 3b4b3b2..580dc8c 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,5 +1,12 @@
class shorewall(
- $startup = '1'
+ $startup = '1',
+ $ensure_version = 'present',
+ $tor_transparent_proxy_host = '127.0.0.1',
+ $tor_transparent_proxy_port = '9040',
+ $tor_user = $::operatingsystem ? {
+ 'Debian' => 'debian-tor',
+ default => 'tor'
+ }
) {
case $::operatingsystem {
@@ -21,19 +28,6 @@ class shorewall(
}
}
- 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,
- }
- }
-
# See http://www.shorewall.net/3.0/Documentation.htm#Zones
shorewall::managed_file{ zones: }
# See http://www.shorewall.net/3.0/Documentation.htm#Interfaces
@@ -66,4 +60,7 @@ class shorewall(
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: }
+
}
diff --git a/manifests/tunnel.pp b/manifests/tunnel.pp
new file mode 100644
index 0000000..e0c71e7
--- /dev/null
+++ b/manifests/tunnel.pp
@@ -0,0 +1,11 @@
+define shorewall::tunnel(
+ $tunnel_type,
+ $zone,
+ $gateway = '0.0.0.0/0',
+ $gateway_zones = '',
+ $order = '1'
+) {
+ shorewall::entry { "tunnel.d/${order}-${title}":
+ line => "# ${name}\n${tunnel_type} ${zone} ${gateway} ${gateway_zones}",
+ }
+}