Hi Cam,
I have not tested the above code, though you say it works in Ruby and
not Puppet, so guessing you have an issue with where the code is on disk
or missing some steps in the process.
Ensure that this code is in
$modulepath:/<module>/lib/facter/videocard.rb. You can remove the
'require facter' line. Then run the puppet agent so that pluginsync puts
the code in the right place. Now run `facter -p videocard` and you
should see your output.
Here's an example[1] of a module with a fact that is similar to what you
are doing. Notice it uses Facter::Util::Resolution.which instead of system.
Here's an example[2] of how to write unit tests for your new fact.
[1] -
https://github.com/ghoneycutt/puppet-module-ssh/blob/master/lib/facter/ssh.rb
[2] -
https://github.com/ghoneycutt/puppet-module-ssh/blob/master/spec/unit/facter/ssh_spec.rb
Best regards,
-g
--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile:
+1.206.414.8658