Forge Home


Install facter and create external facts


9,216 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

  • 0.2.0 (latest)
  • 0.1.2
  • 0.1.1
  • 0.1.0
released May 30th 2015
This version is compatible with:
  • Puppet 3.x
  • , Gentoo, , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'tampakrap-facter', '0.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install tampakrap-facter --version 0.2.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.

Tags: facter, fact


tampakrap/facter — version 0.2.0 May 30th 2015


Build Status Puppet Forge

Manage facter package and create external facts under /etc/facter/facts.d

Facter Package Installation

Since puppet will pull facter as dependency, this module will let you track the installed version. Also, it will create the directory /etc/facter/facts.d, where we can put external facts

See Usage for more installation details.


Additionally, this module provides the fact type/resource, that creates external facts:

fact { 'environment':
  content => 'production',
  target  => 'env',
  ensure  => present,

This will create a file /etc/facter/facts.d/env.txt containing:

  • content is mandatory. It can not be empty string or whitespace.
  • target is optional. It defaults to the name of the resource.
  • ensure is optional. It defaults to present.

The fact provider is based on the filemapper provider extension.


In order to use this module, just import the facter class:

import facter

You can specify extra options for the package installation, such as alternative provider (in case you want to install it from Gem instead of distro package), additional install_options or alternative package_name, or alternative permissions for the /etc/facter and facts.d directories: class { 'facter': package_name => 'rubygem-facter', install_options => {'--no-recommends', '--from': 'third_party_repo'}, ensure => 'latest', owner => 'puppet', group => 'puppet', mode => '0750', }

(Please prefer to use hiera for your data though)


Public Classes

  • facter: Main class to install facter, /etc/facter/facts.d and purge unmanaged resources

Private Classes

  • facter::package: Handles the package installation
  • facter::params: Various platform dependent variables
  • facter::package::portage: Gentoo/Portage specific, handles KEYWORDS and USE flags of the dev-ruby/facter package


The following parameters are available for the hiera class:


The facter package name. Default: facter or platform dependent


The ensure value of the facter package. Default: present


The package provider. Default: undef


The install_options param for the package provider. Default: undef


Whether to purge all unmanaged external facts from /etc/facter/facts.d. Default: false


The owner of the /etc/facter and facts.d directories. Default: undef


The group of the /etc/facter and facts.d directories. Default: undef


The mode of the /etc/facter and facts.d directories. Default: undef