so i finally figured out a method, though i'm not gonna lie it's pretty hacky

based on this page https://puppet.com/docs/facter/3.7/custom_facts.html

Using the Ruby load path

Facter searches all directories in the Ruby $LOAD_PATH variable for
subdirectories named facter, and loads all Ruby files in those
directories. If you had a directory in your $LOAD_PATH like
~/lib/ruby, set up like this:

#~/lib/ruby
└── facter
    ├── rackspace.rb
    ├── system_load.rb
    └── users.rb

so if you then

/opt/puppetlabs/puppet/bin/ruby -e 'puts $LOAD_PATH'

you'll get a list if directories that facter should search in for a
directory called 'facter'

i created /opt/puppetlabs/puppet/lib/ruby/site_ruby/facter and dumped
my custom ruby facts into there

running facter or facter -p now picks up those facts and includes them
by default

i'm sure this isn't the best method, but it works for now


On Wed, Apr 25, 2018 at 1:26 PM, R.I.Pienaar <r...@devco.net> wrote:
>
>
> On Wed, 25 Apr 2018, at 19:05, Michael Di Domenico wrote:
>> >> >
>> >> > Perhaps something like this then, though that answer is old, in theory
>> >> > it
>> >> > should probably work for new Puppet:
>> >> >
>> >> > https://ask.puppet.com/question/4645/puppet-apply-and-pluginsync/
>> >> >
>> >>
>> >> In recent Puppet with puppet apply it automatically finds facts in your
>> >> modules, you dont need to copy them anywhere or sync them.
>> >>
>> >> I have not really been following this thread sorry if that's not helpful -
>> >> but it basically just works
>> >
>> > I think the RP is trying to run Facter standalone on the command line, as 
>> > he
>> > mentions FACTERLIB, but yes, "puppet apply" should just work as is.
>>
>> yes, that is true.  i want both facter and puppet to be able to find
>> my custom facts without having to specify an environment variable.
>>
>> thanks for suggestions so far, i'll poke at them and see if something
>> fits the bill
>>
>
> Facter on it's own can't I believe, you have to use puppet facts then you 
> will get facts from modules - but beware the slightly different format.
>
>
> --
> R.I.Pienaar / www.devco.net / @ripienaar
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/1524677188.3836288.1350590520.7354DA1B%40webmail.messagingengine.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CABOsP2NHj971Ht5Q03_YmgtNLPwFeL87o0JRrXva1zPBn_zv1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to