Forge Home


A module to manage custom and static


1,763 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

  • 0.3.2 (latest)
  • 0.3.1
  • 0.3.0
  • 0.2.0
  • 0.1.1
  • 0.1.0
released May 4th 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
  • Puppet >= 6.21.0 < 8.0.0
  • , , , , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'pcfens-static_custom_facts', '0.3.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add pcfens-static_custom_facts
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install pcfens-static_custom_facts --version 0.3.2

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.



pcfens/static_custom_facts — version 0.3.2 May 4th 2022


Build Status

Table of Contents

  1. Description
  2. Setup - The basics of getting started with static_custom_facts
  3. Reference
  4. Development - Guide for contributing to the module


The static_custom_facts module, other than having a long name, manages statically set custom facts for machines. It was originally written to put static (but not static enough to be in the certificate) contact information on servers while also exposing the information in PuppetDB.

Structured facts (hashes and arrays) are supported in addition to traditional facts (strings, numbers, and booleans).

static_custom_facts will only work in Puppet 4.


What static_custom_facts affects

Including static_custom_facts will ensure that the custom facts directory is created. By default, unmanaged files are left alone, but can be purged with the purge_unmanaged parameter.

Where facts are stored is based on the operating system.

On a Linux box, this module uses /opt/puppetlabs/facter/facts.d/. On Windows C:\ProgramData\PuppetLabs\facter\facts.d\ is used.


Public Classes

Class: static_custom_facts

Sets up the custom fact directory.

Parameters within static_custom_facts

  • parent_dirs: [Array] Parent directories of facts_path to create
  • facts_path: [String] The directory where custom facts should be stored. (defaults to an OS specific path)
  • facts_path_owner: [String] The owner of the directory created by facts_path (defaults to root on Linux)
  • facts_path_group: [String] The group owning the directory created by facts_path (defaults to root on Linux)
  • purge_unmanage: [Boolean] If set to true, facts managed outside of Puppet, but in the facts_path directory will be removed (default: false)
  • custom_facts: [Hash] A set of custom facts that should be automatically created. Commonly used with hiera/lookup.

Private Classes

Class: static_custom_facts::params

Sets the default parameters for static_custom_facts based on the operating system used.

Public Defines

Define: static_custom_facts::fact

Creates a fact with the same name as the resource being created.

Parameters for static_custom_facts::fact

  • ensure: The ensure parameter on the fact itself. (default: present)
  • value: The value of the fact itself. Can be a string, array, hash, number, or boolean. (required)


Pull requests and bug reports are welcome. If you're sending a pull request, please consider writing tests if applicable.