diff options
-rw-r--r-- | lib/facter/shorewall_major_version.rb | 2 | ||||
-rw-r--r-- | manifests/rule_section.pp | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/facter/shorewall_major_version.rb b/lib/facter/shorewall_major_version.rb index a733842..0068b48 100644 --- a/lib/facter/shorewall_major_version.rb +++ b/lib/facter/shorewall_major_version.rb @@ -1,5 +1,5 @@ Facter.add("shorewall_major_version") do setcode do - Facter::Util::Resolution.exec('shorewall version').split('.')[0] || nil + Facter::Util::Resolution.exec('shorewall version').split('.').first || nil end end diff --git a/manifests/rule_section.pp b/manifests/rule_section.pp index 08e5708..0a8b4bb 100644 --- a/manifests/rule_section.pp +++ b/manifests/rule_section.pp @@ -1,9 +1,11 @@ # a rule section marker define shorewall::rule_section( - $order + $order, ){ - $rule_section_prefix = $shorewall_major_version ? { - '5' => '?' + if versioncmp($shorewall_major_version,'4') > 0 { + $rule_section_prefix = '?' + } else { + $rule_section_prefix = '' } shorewall::entry{"rules-${order}-${name}": |