http://docs.puppetlabs.com/guides/custom_facts.html
facter have two type custom_facts: custom_facts and external facts
Facter offers a few methods of loading facts:
- $LOAD_PATH, or the ruby library load path
- The environment variable ‘FACTERLIB’
- Facts distributed using pluginsync
you can just use the environment style, puts custom facts in
~/lib/ruby/<os>/facter/ and export FACTERLIB=~/lib/ruby/facter/`uname`
custom facts wrote by ruby code, this is a sample.
# hardware_platform.rb Facter.add("hardware_platform") do setcode do Facter
::Util::Resolution.exec('/bin/uname --hardware-platform') end end
the other style facts is external facts.
External facts provide a way to use arbitrary executables or scripts as
facts, or set facts statically with structured data. If you’ve ever wanted
to write a custom fact in Perl, C, or a one-line text file, this is how.
external facts should default put in /etc/facter/facts.d, and you can use
--external-dir
option to specify.
On Sunday, May 4, 2014 1:50:11 AM UTC+8, Cristian Falcas wrote:
>
> Hello,
>
> Does puppet have a variable for temporary directories for each os, or
> I need to write a custom fact with this?
>
> Best regards,
> Cristian Falcas
>
--
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/379fbab6-5826-424b-9309-99b75e3cefda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.