diff options
author | kwadronaut <kwadronaut@leap.se> | 2018-11-09 10:03:32 +0100 |
---|---|---|
committer | kwadronaut <kwadronaut@leap.se> | 2018-11-09 10:03:32 +0100 |
commit | 74ebf6e34723573a23bf0e758978fb3969e362f8 (patch) | |
tree | 6abed2eb699e572c418d25d9969b2f4b083a83c0 /lib | |
parent | 06e89ed3486916ae12186e46b8ec59c8c7c79142 (diff) | |
parent | cabbf434c1778cb4e8fe2f7f726a012f707cd2a5 (diff) |
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facter/shorewall_major_version.rb | 7 | ||||
-rw-r--r-- | lib/facter/shorewall_version.rb | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/facter/shorewall_major_version.rb b/lib/facter/shorewall_major_version.rb new file mode 100644 index 0000000..017aed3 --- /dev/null +++ b/lib/facter/shorewall_major_version.rb @@ -0,0 +1,7 @@ +Facter.add("shorewall_major_version") do + confine :shorewall_version => /\d/ + setcode do + v = Facter.value('shorewall_version') + v.nil? ? nil : v.split('.').first + end +end diff --git a/lib/facter/shorewall_version.rb b/lib/facter/shorewall_version.rb new file mode 100644 index 0000000..8990088 --- /dev/null +++ b/lib/facter/shorewall_version.rb @@ -0,0 +1,6 @@ +Facter.add('shorewall_version') do + setcode do + Facter::Util::Resolution.exec('shorewall version') + end +end + |