On Sun, Apr 10, 2011 at 1:56 PM, Cody Robertson <c...@hawkhost.com> wrote:

> Can you invoke any custom facts at all? I suspect it facter might not be
> looking in the right directory for your puppet facts and thus it's not
> finding them when run it locally.
>
> I've confirmed no issue with defining multiple facts in a single file /
> calling them with facter locally:
>
> root@falcon [~]# facter --puppet lvecpanel_version
> lve-cpanel-plugin-0.2-1.el5.cloudlinux
>
> root@falcon [~]# facter --puppet lvemanager_version
> cpanel-lvemanager-0.3-2.el5.cloudlinux
>

This is interesting, what is the name of your fact?

I replied on a forked thread, puppet-users was not included, here my
response:

 [root@gnucloud facter]# echo $FACTERLIB

[root@gnucloud facter]# export
FACTERLIB=/opt/puppet/test/modules/foobar/lib/facter
[root@gnucloud facter]# echo $FACTERLIB
/opt/puppet/test/modules/foobar/lib/facter
[root@gnucloud facter]# facter -p foo
[root@gnucloud facter]# pwd
/opt/puppet/test/modules/foobar/lib/facter
[root@gnucloud facter]# ls
foobar.rb
[root@gnucloud facter]# cat foobar.rb
require 'facter'
Facter.add("foo") do
  setcode do
    %x{/bin/date +%s}.chomp
  end
end
Facter.add("bar") do
  setcode do
    %x{/bin/date +%s}.chomp
  end
end

My *guess* is that facter does not like having two facts in one fact, here I
simply created another fact:

[root@gnucloud facter]# cat onefact.rb
require 'facter'
Facter.add("onefact") do

  setcode do
    %x{/bin/date +%s}.chomp
  end
end

[root@gnucloud facter]# facter -p onefact
1302309123

Working without issues..

Doing another test, this time I just renamed the file with the fact:

[root@gnucloud facter]# mv onefact.rb onefact2.rb
[root@gnucloud facter]# facter -p onefact
[root@gnucloud facter]# facter -p onefact2
[root@gnucloud facter]#

aha!, seems like facter is looking for the fact name that matches the file,
woot! is this ok? is this the expected behavior?

Then somehow my assumption was correct, facter is not able to pick facts
that the name of the file differs from the fact defined, anyway puppet
processes them correctly.

 --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>



-- 
Tony
http://blog.tonyskapunk.net

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to