2016-01-29 17:38:41 +01:00
|
|
|
Facter.add(:nginx_version) do
|
|
|
|
setcode do
|
2016-02-05 08:11:15 +01:00
|
|
|
if Facter::Util::Resolution.which('nginx')
|
|
|
|
nginx_version = Facter::Util::Resolution.exec('nginx -v 2>&1')
|
2016-01-29 17:38:41 +01:00
|
|
|
%r{^nginx version: nginx\/([\w\.]+)}.match(nginx_version)[1]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|