Dan White
2012-Jun-19 15:56 UTC
[Puppet Users] Question about puppetlabs/stdlib (/etc/facter/facts.d)
This may be an obvious question, but I''d rather ask than guess at it. Do the actual file names have any meaning to puppet or facter ? Seems to me that as long as the facts are syntactically correct and do not conflict with facts in any other file, the file names are only important to the human maintainer of this fact collection. Is this accurate ? “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jeff McCune
2012-Jun-19 20:03 UTC
Re: [Puppet Users] Question about puppetlabs/stdlib (/etc/facter/facts.d)
On Tue, Jun 19, 2012 at 8:56 AM, Dan White <ygor@comcast.net> wrote:> This may be an obvious question, but I''d rather ask than guess at it. > > Do the actual file names have any meaning to puppet or facter ? >They used to matter with Facter, but they don''t since 1.5.8. You can see this by running `facter uptime_days` from the command line. The fact is actually implemented in uptime.rb, so Facter wouldn''t load the right file in 1.5.7 and prior. It would think the fact doesn''t exist as a result. In 1.5.8 and later, Facter loads all facts from all files and evaluates the one you explicitly request. So it doesn''t matter anymore in 1.5.8 and later. In Puppet, you should name your custom types and providers matching the name of the type and provider. This is because the autoloader in Puppet behaves differently than Facter''s loading mechanism. The autoloader expects types, providers, functions, faces, and reports to be located in a path based on their name.> Seems to me that as long as the facts are syntactically correct and do not > conflict with facts in any other file, > the file names are only important to the human maintainer of this fact > collection. > > Is this accurate ? >Yes, for custom facts with Facter 1.5.8 and later it''s accurate. -Jeff -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Dan White
2012-Jun-19 22:52 UTC
Re: [Puppet Users] Question about puppetlabs/stdlib (/etc/facter/facts.d)
Thanks for the response, Jeff. On Jun 19, 2012, at 4:03 PM, Jeff McCune wrote:> On Tue, Jun 19, 2012 at 8:56 AM, Dan White <ygor@comcast.net> wrote: > This may be an obvious question, but I''d rather ask than guess at it. > > Do the actual file names have any meaning to puppet or facter ? > > They used to matter with Facter, but they don''t since 1.5.8. > > You can see this by running `facter uptime_days` from the command line. The fact is actually implemented in uptime.rb, so Facter wouldn''t load the right file in 1.5.7 and prior. It would think the fact doesn''t exist as a result. In 1.5.8 and later, Facter loads all facts from all files and evaluates the one you explicitly request. So it doesn''t matter anymore in 1.5.8 and later.I think I covered that with "no conflicting facts". If the system already has a fact "uptime_days", then I would not want to try to re-define it.> In Puppet, you should name your custom types and providers matching the name of the type and provider. This is because the autoloader in Puppet behaves differently than Facter''s loading mechanism. The autoloader expects types, providers, functions, faces, and reports to be located in a path based on their name.This makes perfect sense -- with one tiny possible exception: I started out talking about custom facts. I agree with what you are saying about types and providers and such, but I started, to paraphrase the great Jack Webb, with just the facts. :)> Seems to me that as long as the facts are syntactically correct and do not conflict with facts in any other file, > the file names are only important to the human maintainer of this fact collection. > > Is this accurate ? > > Yes, for custom facts with Facter 1.5.8 and later it''s accurate.Thanks again. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.