Forge Home

facter_conf

A Puppet module for managing Facter related configuration (facter.conf)

849 downloads

100 latest version

3.1 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

  • 1.3.0 (latest)
  • 1.2.0
  • 1.1.0
  • 1.0.0
released Aug 8th 2024
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2021.7.x
  • Puppet >= 7.24 < 9.0.0
  • , , , , , ,
Tasks:
  • clear_facter_cache_data
  • delete_facter_conf

Start using this module

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

Add this module to your Puppetfile:

mod 'jortencio-facter_conf', '1.3.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jortencio-facter_conf
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jortencio-facter_conf --version 1.3.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: cache, facter

Documentation

jortencio/facter_conf — version 1.3.0 Aug 8th 2024

facter_conf

A Puppet module that is used to configure facter.conf.

For more information, please refer to Configuring Facter with facter.conf

Table of Contents

  1. Description
  2. Setup
  3. Usage
  4. Limitations
  5. Development

Description

facter_conf is a module for easily configuring Facter to set how it interacts with a system, configure fact caching, fact groups and facts/fact groups to block.

Setup

Beginning with facter_conf

By default, facter_conf will simply create an empty facter.conf file.

include facter_conf

Usage

facter_conf supports the use of Hiera data for setting parameters. Please refer to REFERENCE for a list of configurable parameters.

Configure fact caching

---
facter_conf::facts_ttls:
  - timezone: '30 days'
  - os: '1 hour'

Configure fact caching for a custom fact group

---
facter_conf::facts_ttls:
  - custom_fact_group: '30 days'
facter_conf::fact_groups:
  - name: 'custom_fact_group'
    facts:
      - 'os.name'
      - 'ec2_metadata'

Configuring all sections of facter.conf

facter_conf::facts_blocklist: 
  - 'file system'
  - 'EC2' 
  - 'os.architecture'
facter_conf::facts_ttls:
  - timezone: '30 days'
  - os: '30 days'
facter_conf::global_external_dir:
  - 'path1'
  - 'path2'
facter_conf::global_custom_dir:
  - 'custom/path'
facter_conf::global_no_external_facts: false
facter_conf::global_no_custom_facts: false
facter_conf::global_no_ruby: false
facter_conf::cli_debug: false
facter_conf::cli_trace: true
facter_conf::cli_verbose: false
facter_conf::cli_log_level: 'warn'
facter_conf::fact_groups:
  - name: 'custom_fact_group'
    facts:
      - 'os.name'
      - 'ssh'

The same configuration can be done as a class declaration as follows:

  class { 'facter_conf':
    facts_blocklist          => ['file system', 'EC2', 'os.architecture'],
    facts_ttls               => [
      { 'timezone' => '30 days' },
      { 'os' => '30 days' },
    ],
    global_external_dir      => ['path1', 'path2'],
    global_custom_dir        => ['custom/path'],
    global_no_external_facts => false,
    global_no_custom_facts   => false,
    global_no_ruby           => false,
    cli_debug                => false,
    cli_trace                => true,
    cli_verbose              => false,
    cli_log_level            => 'warn',
    fact_groups              => [
      {
        name  => 'custom-group-name',
        facts => ['os.name','ssh'],
      }
    ],
  }

Limitations

This module has only been tested with Facter versions > 4.3.1

Development

If you would like to contribute with the development of this module, please feel free to log development changes in the issues register for this project