/usr/lib/ruby/1.8/facter/lsbmajdistrelease.rb is in facter 1.6.5-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # Fact: lsbmajdistrelease
#
# Purpose: Returns the major version of the operation system version as gleaned
# from the lsbdistrelease fact.
#
# Resolution:
# Parses the lsbdistrelease fact for numbers followed by a period and
# returns those, or just the lsbdistrelease fact if none were found.
#
# Caveats:
#
# lsbmajdistrelease.rb
#
require 'facter'
Facter.add("lsbmajdistrelease") do
confine :kernel => %w{Linux GNU/kFreeBSD}
setcode do
if /(\d*)\./i =~ Facter.value(:lsbdistrelease)
result=$1
else
result=Facter.value(:lsbdistrelease)
end
result
end
end
|