Hi, I can''t seem to get custom facts up and running .. its works if I run it manually but when running puppetd its does not work. puppet version 0.25.1-3 custom fact put in /etc/puppet/modules/hardware/lib/facter/raidcontroller.rb: Facter.add("storagecontroller") do confine :kernel => :linux ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" controller = [] setcode do lspciexists = system "/bin/bash -c ''which lspci >&/dev//null''" if $?.exitstatus == 0 output = %x{lspci} output.each {|s| controller.push($1) if s =~ /RAID bus controller: (.*)/ } output.each {|s| controller.push($1) if s =~ /SCSI storage controller: (.*)/ } end if controller.length==0 controller.push("Unknown") end controller end end #:~/rubylib# facter |grep storagecontroller storagecontroller => Adaptec AAC-RAID (Rocket) (rev 02) but when runnig it through puppetd it does not work but it loads: #:~/rubylib# puppetd --test info: Retrieving plugin info: Loading facts in raidcontroller ........ fileserver.conf: [files] path /etc/puppet/files allow * [modules] allow * [plugins] allow * puppet.conf: [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter pluginsync=true server=puppetteer.netgroup.dk runinterval=3600 report=true [puppetmasterd] templatedir=/var/lib/puppet/templates storeconfigs=false dbadapter=mysql dbuser=puppet dbpassword=Gaeghai6 dbserver=localhost dbsocket=/var/run/mysqld/mysqld.sock #reports=rrdgraph,tagmail,store,log reportdir=/var/lib/puppet/reports rrddir=/var/lib/puppet/rrd rrdinterval=$runinterval reports=tagmail,store rrdgraph=true can anyone spot what I''m missing ? Best regards Kim -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Kim Gert Nielsen
2010-Jan-04 13:13 UTC
Fwd: [Puppet Users] Missing something with custom facts
Could someone please point me in the right direction to debug this ? its kinda weird that it does not work from within puppet but works great when running it by hand Begin forwarded message: From: Kim Gert Nielsen <kgn@netgroup.dk<mailto:kgn@netgroup.dk>> Date: December 29, 2009 3:30:06 PM GMT+01:00 To: "puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>" <puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>> Subject: [Puppet Users] Missing something with custom facts Reply-To: "puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>" <puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>> Hi, I can''t seem to get custom facts up and running .. its works if I run it manually but when running puppetd its does not work. puppet version 0.25.1-3 custom fact put in /etc/puppet/modules/hardware/lib/facter/raidcontroller.rb: Facter.add("storagecontroller") do confine :kernel => :linux ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" controller = [] setcode do lspciexists = system "/bin/bash -c ''which lspci >&/dev//null''" if $?.exitstatus == 0 output = %x{lspci} output.each {|s| controller.push($1) if s =~ /RAID bus controller: (.*)/ } output.each {|s| controller.push($1) if s =~ /SCSI storage controller: (.*)/ } end if controller.length==0 controller.push("Unknown") end controller end end #:~/rubylib# facter |grep storagecontroller storagecontroller => Adaptec AAC-RAID (Rocket) (rev 02) but when runnig it through puppetd it does not work but it loads: #:~/rubylib# puppetd --test info: Retrieving plugin info: Loading facts in raidcontroller ........ fileserver.conf: [files] path /etc/puppet/files allow * [modules] allow * [plugins] allow * puppet.conf: [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter pluginsync=true server=puppetteer.netgroup.dk runinterval=3600 report=true [puppetmasterd] templatedir=/var/lib/puppet/templates storeconfigs=false dbadapter=mysql dbuser=puppet dbpassword=Gaeghai6 dbserver=localhost dbsocket=/var/run/mysqld/mysqld.sock #reports=rrdgraph,tagmail,store,log reportdir=/var/lib/puppet/reports rrddir=/var/lib/puppet/rrd rrdinterval=$runinterval reports=tagmail,store rrdgraph=true can anyone spot what I''m missing ? Best regards Kim -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com<mailto:puppet-users@googlegroups.com>. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com<mailto:puppet-users+unsubscribe@googlegroups.com>. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 12/29/2009 09:30 AM, Kim Gert Nielsen wrote:> custom fact put in /etc/puppet/modules/hardware/lib/facter/raidcontroller.rb:[snip]> puppet.conf: > [main] > logdir=/var/log/puppet > vardir=/var/lib/puppet > ssldir=/var/lib/puppet/ssl > rundir=/var/run/puppet > factpath=$vardir/lib/facter[snip]> can anyone spot what I''m missing ?It looks like you should be putting your facts in $vardir/lib/facter or /var/lib/puppet/lib/facter. I personally put them in $vardir/facts, but that''s your preference. Try putting your fact there and seeing if it works. -Doug