CFacter

Facter was earlier written in Ruby and collecting facts about the system through Ruby was a slow process. CFacter is a project to rewrite Facter using C++. To enable CFacter in versions of Puppet prior to 4, the cfacter=true option will need to be added to puppet.conf (this requires Facter version 2.4). As of Facter version 3.0, CFacter is now the default Facter implementation. In my experience, the speedup of Facter is remarkable. On my test system, the Ruby version of Facter takes just under 3 seconds to run. The C++ version of Facter runs in just over 200 milliseconds. Custom Ruby facts are still supported via the Ruby API, as well as facts written in any language via the executable script method.

Get Mastering Puppet - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.