From ceb57f6a7073b9f7fddfda3ba5b734b168019285 Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 25 Nov 2012 17:49:37 +0100 Subject: add rtrules --- files/boilerplate/rtrules.footer | 1 + files/boilerplate/rtrules.header | 8 ++++++++ manifests/base.pp | 1 + manifests/init.pp | 2 ++ manifests/rtrules.pp | 11 +++++++++++ 5 files changed, 23 insertions(+) create mode 100644 files/boilerplate/rtrules.footer create mode 100644 files/boilerplate/rtrules.header create mode 100644 manifests/rtrules.pp diff --git a/files/boilerplate/rtrules.footer b/files/boilerplate/rtrules.footer new file mode 100644 index 0000000..5e12d1d --- /dev/null +++ b/files/boilerplate/rtrules.footer @@ -0,0 +1 @@ +#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE diff --git a/files/boilerplate/rtrules.header b/files/boilerplate/rtrules.header new file mode 100644 index 0000000..fd9b2f4 --- /dev/null +++ b/files/boilerplate/rtrules.header @@ -0,0 +1,8 @@ +# +# Shorewall version 4 - route rules File +# +# For information about entries in this file, type "man shorewall-rtrules" +# +# For additional information, see http://www.shorewall.net/MultiISP.html +#################################################################################### +# SOURCE DEST PROVIDER PRIORITY MASK diff --git a/manifests/base.pp b/manifests/base.pp index 58b753e..c49c23b 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -42,6 +42,7 @@ class shorewall::base { File["/var/lib/puppet/modules/shorewall/tcdevices"], File["/var/lib/puppet/modules/shorewall/tcrules"], File["/var/lib/puppet/modules/shorewall/tcclasses"], + File["/var/lib/puppet/modules/shorewall/rtrules"], ], require => Package[shorewall], } diff --git a/manifests/init.pp b/manifests/init.pp index f69a6f2..72e0533 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -72,4 +72,6 @@ class shorewall { # See http://www.shorewall.net/3.0/traffic_shaping.htm shorewall::managed_file { tcclasses: } + shorewall::managed_file { rtrules: } + } diff --git a/manifests/rtrules.pp b/manifests/rtrules.pp new file mode 100644 index 0000000..eeb7cc6 --- /dev/null +++ b/manifests/rtrules.pp @@ -0,0 +1,11 @@ +define shorewall::rtrules( + $source = '-', + $destination = '-', + $provider, + $priority, + $mark, +){ + shorewall::entry { "rtrules.d/${mark}-${title}": + line => "# ${name}\n${source} ${destination} ${provider} ${priority} ${mark}", + } +} -- cgit v1.2.3 From 8db3b2ad945642c925713c8da792e2b405bfe6ab Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 25 Nov 2012 18:27:20 +0100 Subject: rtrules: added default priority --- manifests/rtrules.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/rtrules.pp b/manifests/rtrules.pp index eeb7cc6..34e12b4 100644 --- a/manifests/rtrules.pp +++ b/manifests/rtrules.pp @@ -2,7 +2,7 @@ define shorewall::rtrules( $source = '-', $destination = '-', $provider, - $priority, + $priority = '10000', $mark, ){ shorewall::entry { "rtrules.d/${mark}-${title}": -- cgit v1.2.3 From faf6fba9579e285efd28f2ef96a7e3a5d4a5dd4b Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 25 Nov 2012 18:27:33 +0100 Subject: added provider --- files/boilerplate/providers.footer | 1 + files/boilerplate/providers.header | 9 +++++++++ manifests/base.pp | 1 + manifests/init.pp | 1 + manifests/providers.pp | 13 +++++++++++++ 5 files changed, 25 insertions(+) create mode 100644 files/boilerplate/providers.footer create mode 100644 files/boilerplate/providers.header create mode 100644 manifests/providers.pp diff --git a/files/boilerplate/providers.footer b/files/boilerplate/providers.footer new file mode 100644 index 0000000..5e12d1d --- /dev/null +++ b/files/boilerplate/providers.footer @@ -0,0 +1 @@ +#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE diff --git a/files/boilerplate/providers.header b/files/boilerplate/providers.header new file mode 100644 index 0000000..b4a5990 --- /dev/null +++ b/files/boilerplate/providers.header @@ -0,0 +1,9 @@ +# +# Shorewall version 4 - Providers File +# +# For information about entries in this file, type "man shorewall-providers" +# +# For additional information, see http://shorewall.net/MultiISP.html +# +############################################################################################ +#NAME NUMBER MARK DUPLICATE INTERFACE GATEWAY OPTIONS COPY diff --git a/manifests/base.pp b/manifests/base.pp index c49c23b..c50aa6e 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -43,6 +43,7 @@ class shorewall::base { File["/var/lib/puppet/modules/shorewall/tcrules"], File["/var/lib/puppet/modules/shorewall/tcclasses"], File["/var/lib/puppet/modules/shorewall/rtrules"], + File["/var/lib/puppet/modules/shorewall/providers"], ], require => Package[shorewall], } diff --git a/manifests/init.pp b/manifests/init.pp index 72e0533..0bdc50d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -73,5 +73,6 @@ class shorewall { shorewall::managed_file { tcclasses: } shorewall::managed_file { rtrules: } + shorewall::managed_file { providers: } } diff --git a/manifests/providers.pp b/manifests/providers.pp new file mode 100644 index 0000000..d179247 --- /dev/null +++ b/manifests/providers.pp @@ -0,0 +1,13 @@ +define shorewall::providers( + $number, + $mark, + $duplicate = '-', + $interface, + $gateway, + $options = '-', + $copy = '', +){ + shorewall::entry { "providers.d/${mark}-${title}": + line => "${name} ${number} ${mark} ${duplicate} ${interface} ${gateway} ${options} ${copy}", + } +} -- cgit v1.2.3