Forge Home

external_facts

Module to manage external facts

1,249 downloads

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

  • 2.0.1 (latest)
  • 2.0.0
released Apr 27th 2021
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, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 8.0.0
  • , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'tykeal-external_facts', '2.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add tykeal-external_facts
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install tykeal-external_facts --version 2.0.1

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

Documentation

tykeal/external_facts — version 2.0.1 Apr 27th 2021

external_facts

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Overview

Build Status Puppet Forge

The external facts module is a simple wrapper around Facter 1.7+ support for external facts.

This module is a fork of the datacentred/external_facts module as Datacentred went out of business in 2017 and the module is now effectively abandoned.

Module Description

The external facts module installs supporting directory structures and creates external facts on demand. These are defined on your hosts by puppet DSL and on subsequent runs are sent to the master for use in manifest compilation. If the fact definition is removed the fact is automatically purged and will become absent in subsequent puppet runs.

Usage

Enabling Support

Hosts must declare the directory management portion of the module if they want non-existant facts to be purged and no facts are being pushed.

include ::external_facts

NOTE: As long as there is at least one fact being created auto-purging of other non-manged facts will occur even if the base class is not included

Creating facts

This can either be with an implicit value of true

external_facts::fact { 'a_fact': }

or may be declared with an explicit value for use elsewhere

external_facts::fact { 'servicegroups':
  value => 'http,https',
}

As of version 2.0 you may now define the facts as well as fact scripts via hiera as follows:

# define facts to be layed down
external_facts::external_facts:
    a_fact:
        value: true
    b_fact:
        value: http,https

# define scripts to be layed down
external_facts::scripts:
    "content-facts.sh":
        content: |
            #!/bin/bash
            echo FOO=bar
    "source-facts.sh":
        source: puppet:///modules/profile/facts/source-facts.sh

Limitations

This module should work on all GNU Linux systems, but has only been tested on Ubuntu and RedHat.

Development

Development for this module is happening at https://github.com/tykeal/puppet-external-facts

To contribute please open a Pull Request

A DCO line indicated by a Signed-off-by in the commit footer of every commit of a patch series, not just your merge request is required. If any of the commits in the series do not contain this, the request will be rejected.

Pre-commit is used by this repository to enforce code cleanliness. Please make sure you have installed it as well as the commit-msg hooks. If pre-commit validation fails the PR will be rejected and only accepted after code changes as amended updates (no add on fix-up commits that repair bad something that would have been caught by pre-commit)