diff --git a/lib/facter/nginx_version.rb b/lib/facter/nginx_version.rb index 5a4de0ca9..6509d774b 100644 --- a/lib/facter/nginx_version.rb +++ b/lib/facter/nginx_version.rb @@ -1,6 +1,8 @@ Facter.add(:nginx_version) do + confine { Facter.value(:kernel) != 'windows' } + confine { Facter.value(:operatingsystem) != 'nexus' } setcode do - if Facter.value('kernel') != 'windows' && (Facter::Util::Resolution.which('nginx') || Facter::Util::Resolution.which('openresty')) + if Facter::Util::Resolution.which('nginx') || Facter::Util::Resolution.which('openresty') nginx_version_command = Facter::Util::Resolution.which('nginx') ? 'nginx -v 2>&1' : 'openresty -v 2>&1' nginx_version = Facter::Util::Resolution.exec(nginx_version_command) %r{nginx version: (nginx|openresty)\/([\w\.]+)}.match(nginx_version)[2]