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
This commit is contained in:
parent
b58a3f4e0c
commit
189cf0725c
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue