Skip to content
Collect and display system facts
Ruby Other
  1. Ruby 99.9%
  2. Other 0.1%
Branch: master
Clone or download
IrimieBogdan (FACT-2347) Fix debug (#291)
* (FACT-2347) Move options to facter-ng from fact_manager.

* (FACT-2347) Add tests.

* (FACT-2347) Remove commented code.

* (FACT-2347) Replace persistent_options and cli options with priority_options.

* (FACT-2347) Rename cli options to priority options.
Latest commit 05b9073 Feb 13, 2020
Type Name Latest commit message Commit time
Failed to load latest commit information.
agent (maint) exclude filesystem gem if win platform Feb 11, 2020
bin (maint) change names Feb 11, 2020
config (main) Bump version number. (#278) Feb 4, 2020
custom_facts (FACT-2086) Use core facts when weight is 0 for custom facts (#118) Oct 29, 2019
docs/diagrams (FACT-2058) Add diagram. Oct 7, 2019
external_facts (FACT-2046) Integrate custom facts (#76) Oct 10, 2019
lib (FACT-2347) Fix debug (#291) Feb 13, 2020
spec (FACT-2347) Fix debug (#291) Feb 13, 2020
tasks (FACT-2254) Force users to specify value when writing rspec tests for… Dec 17, 2019
.gitignore (FACT-1994) Add hocon formatter, add tests. Aug 26, 2019
.jrubyrc (FACT-1953) Add jrubyrc Aug 9, 2019
.rspec (FACT-1953) Fix rspec. Aug 6, 2019
.rubocop.yml (FACT-2347) Fix debug (#291) Feb 13, 2020
.rubycritic.yml Add rubycritic.yml Aug 9, 2019
.travis.yml (maint) use --force on gem update (#225) Jan 6, 2020
CODEOWNERS Add night's watch team. Aug 26, 2019
Gemfile (FACT-2333) Rename facter-ng to facter Feb 11, 2020
LICENSE Initial commit Jul 18, 2019 (FACT-2105) Delete native extension (#157) Nov 15, 2019
Rakefile (FACT-2006) Fix rubocop. Sep 2, 2019
VERSION (main) version bump to 4.0.6 Feb 5, 2020
block_groups.conf Test fixes (#168) Dec 6, 2019 (maint) run rubocop in parallel Feb 10, 2020
facter.conf (FACT-2311) Fix os detection for redhat 5 (#272) Feb 3, 2020
facter.gemspec (maint) re-add ruby and fix rubocop Feb 11, 2020


Build Status Coverage Status Maintainability

Facter is a command-line tool that gathers basic facts about nodes (systems) such as hardware details, network settings, OS type and version, and more. These facts are made available as variables in your Puppet manifests and can be used to inform conditional expressions in Puppet.

Supported platforms

  • Linux
  • macOS
  • Windows
  • Solaris
  • AIX


  • Ruby 2.3+

Basic concepts

The project has three main parts, the framework, facts and resolvers. In the framework we implement functionality that is agnostic of specific facts like parsing user input, formatting output, etc.

Facts are the nuggets of information that will be provided by facter e.g., networking.interfaces, etc.

Resolvers have the role of gathering data from the system. For example a resolver can execute a command on the system, can read a file or any operation that retries some data from a single source on the system.

Facter user interaction

Getting started

After cloning the project, run bundle install to install all dependencies.

You can run facter by executing ./bin/facter. The command will output all the facts that facter detected for the current os.

In order to generate a fact, we can use the rake task rake 'create_fact[<os>,<fact_name>]' e.g. rake 'create_fact[ubuntu,facterversion]' When generating a fact, the unit test for that fact is also generated. Facts should call on or more resolvers in order to obtain the data they need.

The implementation can be validated locally by running the ./ script.

Goals - fast, easy, compatible

  • Gain performance similar to the C++ version of Facter. We plan to achieve this goal by gathering multiple facts with only one call and by using the faster Win32 API rather than WMI for the Windows implementation.
  • Facilitate community contribution. At the moment, C++ presents a possible impediment for community contributions.
  • Enable native integration with other Ruby-based projects such as Bolt and puppet.
  • Enable native integration for custom facts.
  • Provide 100% compatibility with C++ Facter (drop-in replacement).
You can’t perform that action at this time.