Skip to content

Commit

Permalink
Merge pull request voxpupuli#1140 from murdok5/cisco_fact_bug
Browse files Browse the repository at this point in the history
Confine NGINX version fact to exclude Cisco Nexus switches
  • Loading branch information
wyardley committed Nov 3, 2017
2 parents c2ccdf2 + 22e3a48 commit 657e822
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/facter/nginx_version.rb
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 657e822

Please sign in to comment.