I'm a newbie attempting to get a custom fact distributed to clients.
I've followed the instructions at 
http://reductivelabs.com/trac/puppet/wiki/AddingFacts
and based my first fact on a simple recipe.

I'm having at least one problem and possibly more.

1) Puppet/facter fails to load the custom fact, complaining that "non-
sh interpreters are not currently supported"
2) Puppet seems to be loading the fact twice (though that may be
because of the above).

Output on client:
----------
# puppetd -t
info: Loading fact test_fact
info: Retrieving plugins
info: Loading fact test_fact
Could not retrieve test_fact: non-sh interpreters are not currently
supported
Could not retrieve test_fact: non-sh interpreters are not currently
supported
info: Caching catalog at /var/lib/puppet/localconfig.yaml
notice: Starting catalog run
notice: Finished catalog run in 3.94 seconds
----------


Both the client and the server have the following two lines in
puppet.conf's [main] section:
----------
        pluginsync = true
        factpath = $vardir/lib/facter
----------



And I've put test_fact.rb in /etc/puppet/modules/custom/plugins/facter/
test_fact.rb:
----------
# cat modules/custom/plugins/facter/test_fact.rb
# test_fact.rb
## Return symbolic network name based on eth0 subnet.

Facter.add("test_fact") do
        confine :kernel => :linux
        ipaddress=%x{/sbin/ifconfig eth0}.chomp
        iparray = ipaddress.split(".")
        netw = iparray[0]+"."+iparray[1]+"."+iparray[2]  #I never
claimed to be a ruby programmer
        netname = case netw
                when "192.168.4" then "siteA"
                when "10.1.1" then "siteA"
                when "192.168.88" then "siteB"
                else "Unknown"
        end

        netname
end
----------

Running facter on the client machine directly after setting FACTERLIB
to /var/lib/puppet/lib/facter/ shows the same error on the first line
of output: "Could not retrieve test_fact: non-sh interpreters are not
currently supported"

Can anyone shed some light on this issue?

Thanks!


--~--~---------~--~----~------------~-------~--~----~
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