Forge Home

facter

Install facter and create external facts

10,812 downloads

9,282 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

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.

Download
Tags: facter, fact

Documentation

tampakrap/facter — version 0.2.0 May 30th 2015

puppet-facter

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.

fact

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:

environment=production
  • 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.

Usage

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)

Classes

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

Parameters

The following parameters are available for the hiera class:

package_name

The facter package name. Default: facter or platform dependent

ensure

The ensure value of the facter package. Default: present

provider

The package provider. Default: undef

install_options

The install_options param for the package provider. Default: undef

purge_unmanaged

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

owner

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

group

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

mode

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