Forge Home

facter

Manage Facter

86,704 downloads

2,850 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 4.0.0 (latest)
  • 3.5.0
  • 3.4.0
  • 3.3.1
  • 3.3.0
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 2.1.0
  • 2.0.1
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.1
  • 1.2.0
  • 1.1.2
  • 1.0.0 (deleted)
released May 2nd 2022
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
  • Puppet >= 6.0.0 < 8.0.0
  • AIX, Debian, RedHat, CentOS, OracleLinux, Scientific, Solaris, SLES, SLED, Ubuntu, windows

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'ghoneycutt-facter', '4.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ghoneycutt-facter
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ghoneycutt-facter --version 4.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: puppet, facter

Documentation

ghoneycutt/facter — version 4.0.0 May 2nd 2022

puppet-module-facter

Table of Contents

  1. Module Description - What the module does and why it is useful
  2. Setup - The basics of getting started with facter
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Module description

This module manages facter, specifically the facts.d directory, symlinks to facter that are in your PATH and the ability to define external facts.

Setup

What facter affects

Ensure that /etc/facter/facts.d exists with the correct permissions and populate it with facts.txt which is used for external facts. It can optionally create a symlink such as /usr/local/bin/facter to point to facter in the puppet package that may not be in your $PATH.

It has defined types for specifying external facts. This allows you to seed already known information on the system. facter::fact is for traditional key=value where the value is a string. facter::structured_data_fact allows values to be structured data such as arrays and hashes. To achive this, the structured data is converted to YAML format.

Beginning with facter

Declare the main class as demonstrated below.

Usage

You can manage all interaction with facter through the main facter class. To specify external facts, use the facter::fact defined type.

You can optionally specify a hash of external facts in Hiera.

facter::fact

---
facter::facts_hash:
  role:
    value: 'puppetmaster'
  location:
    value: 'RNB'
    file: 'location.txt'

The above configuration in Hiera would produce /etc/facter/facts.d/facts.txt with the following content.

role=puppetmaster

It would also produce /etc/facter/facts.d/location.txt with the following content.

location=RNB

facter::structured_data_fact

---
facter::structured_data_facts_hash:
foo:
  data:
    my_array:
    - one
    - two
    - three
    my_hash:
      k: v
bar:
  data:
    bar_array:
    - one
    - two
    - three
  file: bar.yaml
  facts_dir: /factsdir

The above configuration would create /etc/facter/facts.d/facts.yaml with the fact my_array. It would create /factsdir/bar.yaml with the fact bar_array.

Minimum usage

include facter

Parameters for configuration

Please consult the REFERENCE.md file for all parameters.

Limitations

This module is compatible with the latest release of Puppet versions 5 and 6. It supports all POSIX like platforms as well as Windows. See .travis.yml for an exact matrix of tested Ruby and Puppet versions.

Development

See CONTRIBUTING.md for information related to the development of this module.