puppetlabs / facter

Collect and display system facts
https://puppet.com/open-source/#osp
Apache License 2.0
617 stars 496 forks source link

facter

Gem Version

Modules Status Modules Status Modules Status Test Coverage 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.

Documentation

Documentation for the Facter project can be found on the Puppet Docs site.

Supported platforms

Requirements

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. os.name, 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 retrieves some data from a single source on the system.

sequenceDiagram
    participant user
    participant framework
    participant fact
    participant resolver
    user->>framework: user query
    framework->>fact: create
    fact->>resolver: resolve
    resolver->>fact: system information
    fact->>framework: fact value
    framework->>user: formatted user output

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.

The implementation can be validated locally by running bundle exec rake check.

Goals - fast, easy, compatible

Licensing

See LICENSE file. Puppet is licensed by Puppet, Inc. under the Apache license. Puppet, Inc. can be contacted at: info@puppet.com