Forge Home


A module to convert puppet agent configuration to custom facts for use in manifests


7,648 latest version

4.6 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.0.2 (latest)
  • 1.0.1
  • 1.0.0
released Feb 2nd 2016
This version is compatible with:
  • RedHat, Ubuntu, Debian, OS X, Windows, SLES

Start using this module

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

Add this module to your Puppetfile:

mod 'jhg03a-agentfacts', '1.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jhg03a-agentfacts
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jhg03a-agentfacts --version 1.0.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.



jhg03a/agentfacts — version 1.0.2 Feb 2nd 2016


Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with agentfacts
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Changelog


This is a module to convert agent local configuration data to a structured fact. While not super helpful by itself, it is handy in conjunction with other modules. For example, being able to reference the puppet agent SSL certificate location information from your mCollective profile. It could also be handy when diagnosing what's going on with a particular agent, planning for an upgrade, or figuring out which agents are running as non-default users.

Module Description

This module utilizes the Puppet.settings global variable and converts the output to a structured fact.

For example you may want to know where the ssl keys and certificates are stored on a given agent. You should be able to reference the values agentfacts.hostpubkey, agentfacts.hostprivkey, and agentfacts.localcacert for all the appropriate information. You could use this for instance to create SSL connections to your puppetdb instance to run queries, or as part of your mCollective agent setup. Another handy entry to keep in mind is agentfacts.environment if you needed to run puppetdb queries against only a particular environment's nodes.

Since this is pulling from the puppet ruby code, it ignores the differences between OS. So agentfacts.hostpubkey on linux may look something like /etc/puppetlabs/puppet/ssl/public_keys/ However on Windows it may look something like C:/ProgramData/PuppetLabs/puppet/etc/ssl/public_keys/


What agentfacts affects

This is a read-only module and cannot alter agent information

Beginning with agentfacts

Add this puppet module to your catalog and you should get facts about each puppet agent configuration on your next puppet run.


This adds all the entries from puppet config print as children of the agentfacts structured fact. What values that show up exactly will vary based on your version of the puppet agent and what you may have defined in configuration files. You can refer to the documentation for the specific contents.


  1. Fork it
  2. Submit a pull request


  • v1.0.2 - Fixed bug which wouldn't have set the environment properly when running from facter
  • v1.0.1 - Added additional documentation to readme
  • v1.0.0 - Initial Release