Hi Andreas,

On Tue, May 26, 2015 at 11:16 PM, <[email protected]> wrote:

> Hi,
>
> is it possible to use custom facts inside other custom facts?
>
> With facter -p the custom fact is listed ( e.g.):
>
> ...
> userblweb => 1000
>
> With irb:
>
> irb(main):001:0> require 'facter'
> => true
> irb(main):002:0> a = Facter.value(:userblweb)
> => nil
>
> Any idea?
>

When using the Facter API, Facter needs to be told where the custom facts
are stored:

irb> Facter.search '<path_to_custom_facts>'

Note: despite being a verb, the 'search' method only adds the given path to
the list of search paths.

The same thing happens during Puppet's settings initialization that is
invoked when you pass the '-p' option to Facter (as Thomas mentioned, this
is deprecated).

Likewise, the path can be specified to Facter by using the FACTERLIB
environment variable set to a list of paths to search for custom facts.

Facter 3 will be adding a '--custom-dir' command line option that is
another way of specifying where custom facts are stored.

I hope this helps.


-- 
*Join us at **PuppetConf 2015, October 5-9 in Portland, OR - *www.
<http://www.google.com/url?q=http%3A%2F%2Fwww.&sa=D&sntz=1&usg=AFQjCNEnS7itqgvQV3E4Se1fu4Um_UapSw>
2015.puppetconf.com
<http://www.google.com/url?q=http%3A%2F%2F2015.puppetconf.com&sa=D&sntz=1&usg=AFQjCNE1uQL4Sh23Vr-XkPLa4xfNcoXSog>

*Register early to save 40%!*

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACZQQfOMw7igPKm_ZWKcFWzrv6%3DGguWJbs%2B2aAeaaJdX2QQxMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to