Facter.add(:nsclient) dosetcode doif File.exists?("c:/program files/nsclient++")puts ''nsclient installed'elseputs 'no such directory'endendend
class nscp-test {notify{$nsclient :}}
C:\Documents and Settings\All Users\Application Data\PuppetLabs\puppet\var\lib\facter>puppet agent --testInfo: Retrieving pluginInfo: Loading facts in C:/Documents and Settings/All Users/Application Data/PuppetLabs/puppet/var/lib/facter/nsclient.rbno such directoryno such directoryInfo: Caching catalog for <snipped>Info: Applying configuration version '1360274145'Notice: undefNotice: /Stage[main]/Nscp-test/Notify[undef]/message: defined 'message' as 'undef'Notice: Finished catalog run in 0.42 seconds
Hello all!I am using open source puppet 3.0.1 on both the client and master. The issue I am having is that I cannot get a simple custom fact to be recognized in my manifest. Hopefully I am missing something.
I am trying to have a custom fact that will tell me whether the nsclient++ directory exists or not.Here's the custom fact, which is located at /etc/puppet/environments/windows/modules/nscp-test/lib/facterFacter.add(:nsclient) dosetcode doif File.exists?("c:/program files/nsclient++")puts ''nsclient installed'elseputs 'no such directory'
endendendmy init.pp is dead simple:class nscp-test {notify{$nsclient :}}
Here's what happens when I run puppet agent --test on the client (windows 2003):C:\Documents and Settings\All Users\Application Data\PuppetLabs\puppet\var\lib\facter>puppet agent --testInfo: Retrieving pluginInfo: Loading facts in C:/Documents and Settings/All Users/Application Data/PuppetLabs/puppet/var/lib/facter/nsclient.rbno such directoryno such directoryInfo: Caching catalog for <snipped>Info: Applying configuration version '1360274145'Notice: undefNotice: /Stage[main]/Nscp-test/Notify[undef]/message: defined 'message' as 'undef'Notice: Finished catalog run in 0.42 secondsfrom the command line, facter --puppet nsclient works just fine.So am I missing something dead simple, or what? This is my first time doing custom facts.Thanks,Dan
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.