From fa094e71f5371f7ec639341f85db12fa081b16d4 Mon Sep 17 00:00:00 2001 From: Steffen Zieger Date: Fri, 29 Apr 2016 16:25:24 +0200 Subject: [PATCH] add rsyslog version fact support for Gentoo --- lib/facter/rsyslog_version.rb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/facter/rsyslog_version.rb b/lib/facter/rsyslog_version.rb index 2c4ff3e..7168eb5 100644 --- a/lib/facter/rsyslog_version.rb +++ b/lib/facter/rsyslog_version.rb @@ -24,13 +24,21 @@ Facter.add(:rsyslog_version) do nil end when "FreeBSD" - command='pkg query %v rsyslog8' - version = Facter::Util::Resolution.exec(command) - if version =~ /^(.+)$/ - $1 - else - nil - end + command='pkg query %v rsyslog8' + version = Facter::Util::Resolution.exec(command) + if version =~ /^(.+)$/ + $1 + else + nil + end + when "Gentoo" + command='equery -q -C list -F \'$version\' rsyslog' + version = Facter::Util::Resolution.exec(command) + if version =~ /^(.+)$/ + $1 + else + nil + end else nil end