Revert "Moving fact to the same place as the custom function"

This reverts commit e546635780.
This commit is contained in:
Gene Liverman 2017-10-15 17:34:16 -07:00
parent e546635780
commit c8d218fee8

View file

@ -0,0 +1,19 @@
Facter.add(:os_release) do
confine kernel: 'Linux'
setcode do
file_path = '/etc/os-release'
if File.exist?(file_path)
os_release_hash = {}
File.open(file_path, 'r') do |file|
file.each_line do |line|
line_data = line.split('=')
key = line_data[0].downcase
value = line_data[1].strip.gsub(/(^\")|(\"$)/, '')
os_release_hash[key] = value
end
end
os_release_hash
end
end
end