From 189cf0725c8d71cac222e4e72472e8f920b56f78 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 8 Jun 2016 12:01:17 +0200 Subject: [PATCH] make fact work on old nginx as well CentOS 7 (default fact works): nginx version: nginx/1.10.0 CentOS 6: nginx: nginx version: nginx/1.0.0 --- lib/facter/nginx_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/nginx_version.rb b/lib/facter/nginx_version.rb index f4c1372..7918547 100644 --- a/lib/facter/nginx_version.rb +++ b/lib/facter/nginx_version.rb @@ -2,7 +2,7 @@ Facter.add(:nginx_version) do setcode do if Facter::Util::Resolution.which('nginx') nginx_version = Facter::Util::Resolution.exec('nginx -v 2>&1') - %r{^nginx version: nginx\/([\w\.]+)}.match(nginx_version)[1] + %r{nginx version: nginx\/([\w\.]+)}.match(nginx_version)[1] end end end