I've been using the following code for a really long time now-- I think I
'borrowed' it from someone else.
# videocards.rb
controllers = []
output = %x{lspci}
output.each_line {|s|
controllers.push($1) if s =~ /VGA compatible controller: (.*)/
}
for vc in 0...controllers.length
thecard = "videocard" + vc.to_s
Facter.add(thecard) do
setcode do
controllers[vc]
end
end
end
Obviously it's only going to work if lspci is in the path when puppet runs.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/66d00b30-884d-41fb-9ee4-fed94a24844c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.