Skip to content

Instantly share code, notes, and snippets.

@glarizza
Created December 5, 2013 15:59
Show Gist options
  • Save glarizza/7807991 to your computer and use it in GitHub Desktop.
Save glarizza/7807991 to your computer and use it in GitHub Desktop.
# Iterate through list of packages
IO.popen('repoquery --installed -a --qf \'%{name} %{version}\'').readlines.map(&:chomp).each do |line|
name, version = line.split
Facter.add("yum_#{name}_version") do
setcode do
version
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment