In reply to myself... (as i'm really not an expert) our setup is actually using module/lib/facter as noted here https://docs.puppetlabs.com/guides/plugins_in_modules.html
and below is an example of my test env, which works with facts. /etc/puppet/environments/production/modules/base/lib/facter/puppet_info.rb /etc/puppet/environments/staging/modules/base/lib/facter/puppet_info.rb /etc/puppet/environments/test/modules/base/lib/facter/puppet_info.rb As you can see i'm very much learning as I go as well. On Wednesday, 24 September 2014 17:58:08 UTC+9:30, David LeVene wrote: > > Hey JonY, > > Firstly, i'm not an expert but hopefully this assist you > > We are using the single dir config as we're currently running on an older > version of puppet, but this link should give you the information you > require. > https://docs.puppetlabs.com/facter/2.0/custom_facts.html#fact-locations > > A snippet from the page above says.. > The best way to distribute external facts is with pluginsync, which added > support for them in Puppet 3.4 > <https://docs.puppetlabs.com/puppet/3/reference/release_notes.html#preparations-for-syncing-external-facts> > /Facter 2.0.1 > <https://docs.puppetlabs.com/facter/2.0/release_notes.html#pluginsync-for-external-facts>. > > To add external facts to your puppet modules, just place them in > <MODULEPATH>/<MODULE>/facts.d/. > > eg > /etc/puppet/environments/production/modules/<modulename>/facts.d/<fact_name>.rb > > Each environment will use its own custom facts which is what you want so > you can test a custom fact in the test env > (/etc/puppet/environments/test/modules/base/lib/facter/) before you push to > others etc. > > Having the custom fact present in this directory should deploy it on the > servers (it does for me!) > > To answer your 2 questions directly; > 1. What step(s) did I miss in getting my facts to be distributed? > None from what I've seen - just your custom facts are in the wrong > folder > 2. When I split up my network into 'production', 'test', etc folders for > use in environments - what happens to custom facts then? > The facts are unique per environment > > Hope this helps > > Cheers > David > > > > On Tuesday, 23 September 2014 22:00:40 UTC+9:30, JonY wrote: >> >> I'm attempting to make the jump to directory-based environments and am >> curious about what to do with custom facts. >> >> In my current config I've tried putting custom facts into a separate >> module as /etc/puppet/modules/facts/{manifest,lib} and >> /etc/puppet/modules/facts/lib/facter/<modules go here>. I haven't had any >> success in getting these to propagate to clients though. >> >> I've added 'pluginsync=true' to puppet.conf on server/clients. >> >> Reading the various docs doesn't make it sound like I need a manifest for >> custom facts. Truth? How about a class file? >> >> Questions: >> >> 1. What step(s) did I miss in getting my facts to be distributed? >> 2. When I split up my network into 'production', 'test', etc folders for >> use in environments - what happens to custom facts then? >> > -- 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/3ba2dc56-26df-4c6c-b38d-baa9921230e3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
