Hi,

I'm trying to get videocard information into facter for installation of 
drivers. I've been able to
get to the point of getting it to work in ruby, but not in Puppet. One 
thing I need to do is
remove non-word characters, such as brackets, hash symbols, etc, as I run a 
grep command
in my Puppet manifest which doesn't work when certain special characters 
are present (apart from a comma).

This is what I have so far:

require 'facter'

Facter.add("videocard") do
  confine :kernel => :linux
  ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin"
  setcode do
  ctrl = []
  lspciexists = system "/bin/bash -c 'which lspci >&/dev/null'"
  if $?.exitstatus == 0
    output = %x{lspci}
    output.split("\n").each {|s|
    if s =~ /VGA\s+compatible\s+controller/
      s.gsub!(/(\W)/, " ").gsub!(/\s+/," ")
      ctrl << s
      end
    }
    end
    controllers.join(',')
  end
end

What am I doing wrong here?

Thanks for any help,

-Cam

-- 
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/351cb137-6689-44e7-b92e-84008d736372%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to