zulip/servers/puppet/modules/puppet-apt/lib/facter/apt_version.rb

11 lines
163 B
Ruby

output = %x{apt-get -v 2>&1}
if $?.exitstatus and output.match(/apt (\d+\.\d+\.\d+).*/)
Facter.add("apt_version") do
setcode do
$1
end
end
end