Issue #1918 has been updated by luke.

kuko wrote:
> This is a CentOS 5 host with latest puppet and facter from epel repo. How can 
> I debug the problem? If it's a bug in the RPM packages I will report it to 
> EPEL

Edit the Facter executable to print $LOAD_PATH after the 'require "puppet"' is 
called.  If your Puppet libdir isn't in the ruby loadpath, then that's the 
problem.  If it is, then, well, something even weirder is going on.  But that's 
what loading Puppet does for you -- adds its libdir to your ruby Load path.

Hmm, I just realized - are you overriding the value of 'libdir' or some parent 
dir in your Puppet configuration?  If so, that's probably the problem; Facter 
doesn't tell Puppet to load its configuration, and it would need so for that to 
work.  Try adding 'Puppet.parse_config' after the 'require "puppet"'' line in 
Facter, see if that fixes it.

It's also worth just making sure your fact works:
<pre>
ruby -rfacter .../path/to/fact.rb
</pre>

And try loading the Puppet libs yourself:
<pre>
ruby -rpuppet /path/to/facter | grep testfact
</pre>
----------------------------------------
Bug #1918: facter --puppet doesn't do anything for me
http://projects.reductivelabs.com/issues/1918

Author: bran
Status: Needs more information
Priority: Normal
Assigned to: luke
Category: 
Target version: 
Complexity: Unknown
Keywords: 


My facter doesn't seem to do the right thing with the --puppet option. It 
doesn't seem to output my custom rules.

The values are picked up by puppet when used, but not by facter on the command 
line.


Details:
<pr>
facter 1.5.1-0.1
puppet 0.24.7-1
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
debian etch
</pre>

Files:
<pre>
/etc/puppet/puppet.conf:
[main]
logdir = /var/log/puppet
vardir = /var/lib/puppet
ssldir = /var/lib/puppet/ssl
rundir = /var/run/puppet
pluginsync = true
factpath = /var/lib/puppet/lib/facter
</pre?

Output:
<pre>
[r...@foo-vm:~]# facter --puppet
architecture => amd64
domain => dc1.whee.com
facterversion => 1.5.1
fqdn => foo-vm.dc1.whee.com
hardwareisa => unknown
hardwaremodel => x86_64
hostname => foo-vm
id => root
interfaces => eth0,sit0
ipaddress => 192.168.1.162
ipaddress_eth0 => 192.168.1.162
kernel => Linux
kernelrelease => 2.6.18-6-xen-amd64
kernelversion => 2.6.18
lsbdistcodename => etch
lsbdistdescription => Debian GNU/Linux 4.0 (etch)
lsbdistid => Debian
lsbdistrelease => 4.0
lsbmajdistrelease => 4
macaddress => 00:16:3E:26:C9:DC
macaddress_eth0 => 00:16:3E:26:C9:DC
memoryfree => 612.24 MB
memorysize => 2.00 GB
netmask => 255.255.255.0
netmask_eth0 => 255.255.255.0
operatingsystem => Debian
operatingsystemrelease => 4.0
processor0 => Intel(R) Xeon(R) CPU            5150  @ 2.66GHz
processor1 => Intel(R) Xeon(R) CPU            5150  @ 2.66GHz
processorcount => 2
ps => ps -ef
puppetversion => 0.24.7
rubysitedir => /usr/local/lib/site_ruby/1.8
rubyversion => 1.8.7
sshdsakey => blahblahblah
sshrsakey => blahblahblah
swapfree => 1023.97 MB
swapsize => 1023.99 MB
uniqueid => a8c0a25b
virtual => xenu


[r...@foo-vm:~]# FACTERLIB=/var/lib/puppet/lib/facter/ facter          
acpi_available => absent
architecture => amd64
definterface => eth0
domain => dc1.whee.com
facterversion => 1.5.1
fqdn => foo-vm.dc1.whee.com
hardwareisa => unknown
hardwaremodel => x86_64
hostname => foo-vm
id => root
interfaces => eth0,sit0
interfacez => eth0
ipaddress => 192.168.1.162
ipaddress_eth0 => 192.168.1.162
kernel => Linux
kernelrelease => 2.6.18-6-xen-amd64
kernelversion => 2.6.18
lib => /var/lib/puppet/lib/facter/
lsbdistcodename => etch
lsbdistdescription => Debian GNU/Linux 4.0 (etch)
lsbdistid => Debian
lsbdistrelease => 4.0
lsbmajdistrelease => 4
macaddress => 00:16:3E:26:C9:DC
macaddress_eth0 => 00:16:3E:26:C9:DC
memoryfree => 633.28 MB
memorysize => 2.00 GB
netmask => 255.255.255.0
netmask_eth0 => 255.255.255.0
operatingsystem => Debian
operatingsystemrelease => 4.0
processor0 => Intel(R) Xeon(R) CPU            5150  @ 2.66GHz
processor1 => Intel(R) Xeon(R) CPU            5150  @ 2.66GHz
processorcount => 2
ps => ps -ef
puppetversion => 0.24.7
rubysitedir => /usr/local/lib/site_ruby/1.8
rubyversion => 1.8.7
sshdsakey => wheewheewhee
sshrsakey => foofoofoofoo
swapfree => 1023.97 MB
swapsize => 1023.99 MB
uniqueid => a8c0a25b
virtual => xenu
whatraid => unknown

[r...@foo-vm:~]# ls -l /var/lib/puppet/lib/facter/                 
total 20
-rw-r--r-- 1 root root  234 2009-01-29 11:26 acpi_available.rb
-rw-r--r-- 1 root root  619 2009-01-29 12:55 definterface.rb
-rw-r--r-- 1 root root  427 2009-01-29 12:33 interfaces.rb
-rw-r--r-- 1 root root 1441 2009-01-29 11:26 isvm.rb
-rw-r--r-- 1 root root  877 2009-01-29 11:26 whatraid.rb
</pre>



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to