From f637fe18c3696f978afb420ec9d587c6b1b317f5 Mon Sep 17 00:00:00 2001 From: Edouard Dausque Date: Fri, 10 Feb 2017 10:37:39 +0100 Subject: [PATCH] Fix issues with defaults options and some types Default option 'family' is supported only by hash sets except for hash:mac and default options 'hashsize' and 'maxelem' are supported only by hash sets. This patch deletes from default_options theses options, depending to the type name. --- manifests/init.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 6a5745b..817e87a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -18,7 +18,17 @@ 'maxelem' => '65536', } - $actual_options = merge($default_options, $options) + if $type == 'hash:mac' { + # family option is not available for type hash:mac + $_default_options = delete($default_options, 'family') + } elsif $type !~ /^hash:/ { + # family, hashsize and maxelem options are available only for hash:* (except hash:mac) + $_default_options = delete($default_options, ['family','hashsize','maxelem']) + } else { + $_default_options = $default_options + } + + $actual_options = merge($_default_options, $options) if $ensure == 'present' { # assert "present" target