summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2017-04-07 15:50:11 +0200
committermh <mh@immerda.ch>2017-04-07 15:50:11 +0200
commit89a350feaa3e5f94d104ac7e98af608db659e871 (patch)
treea7f061e124cf5b1a7af76bd43afa7338b4786817
parent59c1cd6c0b9277c07fb577be0f59ce74154352da (diff)
calculate whether we want to disable ipv6 (if there is no public ipv6 address) or not
-rw-r--r--manifests/base.pp4
-rw-r--r--manifests/init.pp16
2 files changed, 14 insertions, 6 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 22ef555..23d72e5 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -38,10 +38,10 @@ class shorewall::base {
'STARTUP_ENABLED':
value => $startup_str;
}
- $cfs = keys($shorewall::settings)
+ $cfs = keys($shorewall::merged_settings)
shorewall::config_settings{
$cfs:
- settings => $shorewall::settings;
+ settings => $shorewall::merged_settings;
}
}
diff --git a/manifests/init.pp b/manifests/init.pp
index aac1520..44c703b 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -2,10 +2,7 @@
class shorewall(
$startup = true,
$conf_source = false,
- $settings = {
- 'LOG_MARTIANS' => 'No',
- 'DISABLE_IPV6' => 'Yes',
- },
+ $settings = {},
$ensure_version = 'present',
$tor_transparent_proxy_host = '127.0.0.1',
$tor_transparent_proxy_port = '9040',
@@ -52,6 +49,17 @@ class shorewall(
$daily_check = true,
) {
+ $disable_ipv6 = $ipaddress6 ? {
+ undef => 'Yes',
+ default => 'No',
+ }
+ $def_settings = {
+ 'LOG_MARTIANS' => 'No',
+ 'DISABLE_IPV6' => $disable_ipv6,
+ }
+
+ $merged_settings = merge($def_settings,$settings)
+
case $::operatingsystem {
'Gentoo': { include ::shorewall::gentoo }
'Debian','Ubuntu': { include ::shorewall::debian }