diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2009-08-24 15:24:14 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2009-08-24 15:24:14 -0300 |
commit | eda4f69cce2f2cd62f3288bdee9d8459c4673ce9 (patch) | |
tree | 609ef5bd7e84959033dfdfb0430e3db2e50429fc | |
parent | 5348aafd849d59887051514a004b3c2d4730c8b3 (diff) | |
download | puppet-shorewall-eda4f69cce2f2cd62f3288bdee9d8459c4673ce9.tar.gz puppet-shorewall-eda4f69cce2f2cd62f3288bdee9d8459c4673ce9.tar.bz2 |
Adding boilerplate files and minor fixes
-rw-r--r-- | files/boilerplate/tcclasses.footer | 1 | ||||
-rw-r--r-- | files/boilerplate/tcclasses.header | 9 | ||||
-rw-r--r-- | files/boilerplate/tcdevices.footer | 1 | ||||
-rw-r--r-- | files/boilerplate/tcdevices.header | 10 | ||||
-rw-r--r-- | files/boilerplate/tcrules.footer | 1 | ||||
-rw-r--r-- | files/boilerplate/tcrules.header | 15 | ||||
-rw-r--r-- | manifests/init.pp | 12 |
7 files changed, 43 insertions, 6 deletions
diff --git a/files/boilerplate/tcclasses.footer b/files/boilerplate/tcclasses.footer new file mode 100644 index 0000000..5e12d1d --- /dev/null +++ b/files/boilerplate/tcclasses.footer @@ -0,0 +1 @@ +#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE diff --git a/files/boilerplate/tcclasses.header b/files/boilerplate/tcclasses.header new file mode 100644 index 0000000..025415b --- /dev/null +++ b/files/boilerplate/tcclasses.header @@ -0,0 +1,9 @@ +# +# Shorewall version 4 - Tcclasses File +# +# For information about entries in this file, type "man shorewall-tcclasses" +# +# See http://shorewall.net/traffic_shaping.htm for additional information. +# +############################################################################### +#INTERFACE:CLASS MARK RATE CEIL PRIORITY OPTIONS diff --git a/files/boilerplate/tcdevices.footer b/files/boilerplate/tcdevices.footer new file mode 100644 index 0000000..5e12d1d --- /dev/null +++ b/files/boilerplate/tcdevices.footer @@ -0,0 +1 @@ +#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE diff --git a/files/boilerplate/tcdevices.header b/files/boilerplate/tcdevices.header new file mode 100644 index 0000000..fe7c3d1 --- /dev/null +++ b/files/boilerplate/tcdevices.header @@ -0,0 +1,10 @@ +# +# Shorewall version 4 - Tcdevices File +# +# For information about entries in this file, type "man shorewall-tcdevices" +# +# See http://shorewall.net/traffic_shaping.htm for additional information. +# +############################################################################### +#NUMBER: IN-BANDWITH OUT-BANDWIDTH OPTIONS REDIRECTED +#INTERFACE INTERFACES diff --git a/files/boilerplate/tcrules.footer b/files/boilerplate/tcrules.footer new file mode 100644 index 0000000..5e12d1d --- /dev/null +++ b/files/boilerplate/tcrules.footer @@ -0,0 +1 @@ +#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE diff --git a/files/boilerplate/tcrules.header b/files/boilerplate/tcrules.header new file mode 100644 index 0000000..e0e7adc --- /dev/null +++ b/files/boilerplate/tcrules.header @@ -0,0 +1,15 @@ +# +# Shorewall version 4 - Tcrules File +# +# For information about entries in this file, type "man shorewall-tcrules" +# +# See http://shorewall.net/traffic_shaping.htm for additional information. +# For usage in selecting among multiple ISPs, see +# http://shorewall.net/MultiISP.html +# +# See http://shorewall.net/PacketMarking.html for a detailed description of +# the Netfilter/Shorewall packet marking mechanism. +###################################################################################################################### +#MARK SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER +# PORT(S) PORT(S) + diff --git a/manifests/init.pp b/manifests/init.pp index 84ce030..20093e9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -204,25 +204,25 @@ class shorewall { # See http://www.shorewall.net/3.0/traffic_shaping.htm managed_file { tcdevices: } - define tcdevices($in_bandwidth, $out_bandwidth, $order='100'){ + define tcdevices($in_bandwidth, $out_bandwidth, $options = '-', $redirected_interfaces = '', $order='100'){ entry { "tcdevices.d/${order}-${title}": - line => "${name} ${in_bandwidth} ${out_bandwidth}", + line => "${name} ${in_bandwidth} ${out_bandwidth} ${options} ${redirected_interfaces}", } } # See http://www.shorewall.net/3.0/traffic_shaping.htm managed_file { tcrules: } - define tcrules($source, $destination, $protocol, $ports , $order='1'){ + define tcrules($source, $destination, $protocol = 'all', $ports, $client_ports = '-', $order='1'){ entry { "tcrules.d/${order}-${title}": - line => "# ${name}\n${order} ${source} ${destination} ${protocol} ${ports}", + line => "# ${name}\n${order} ${source} ${destination} ${protocol} ${ports} ${client_ports}", } } # See http://www.shorewall.net/3.0/traffic_shaping.htm managed_file { tcclasses: } - define tcclasses($rate, $ceil, $priority, $options , $order='1'){ + define tcclasses($interface, $rate, $ceil, $priority, $options = '' , $order='1'){ entry { "tcclasses.d/${order}-${title}": - line => "${name} ${order} ${rate} ${ceil} ${priority} ${options}", + line => "# ${name}\n${interface} ${order} ${rate} ${ceil} ${priority} ${options}", } } |