Forge Home

fakts

Manages facts

6,307 downloads

5,334 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

  • 1.0.0 (latest)
  • 0.2.0
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Jul 2nd 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 6.0.0
  • , , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'bibigon812-fakts', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add bibigon812-fakts
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install bibigon812-fakts --version 1.0.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: facts, facter

Documentation

bibigon812/fakts — version 1.0.0 Jul 2nd 2018

fakts

This module manages facts via files.

Table of Contents

  1. Description
  2. Usage - Configuration options and additional functionality
  3. Reference - An under-the-hood peek at what the module is doing and how

Description

This class manages custom facts. Facts in the JSON format are stored into the directory '/etc/facter/facts.d' by default.

Usage

include fakts
fakts::static:
  groups:
    value:
      - foo
      - bar

Roles

if you are going to manage roles, you can use this module to push roles to nodes.

Prepare the hiera configuration file

# hiera.yaml
---
version: 5
defaults:
hierarchy:
  - name: "Per-node data (yaml version)"
    path: "nodes/%{::trusted.certname}.yaml"
  - name: "Per-role data (yaml version)"
    mapped_paths: [roles, var, "roles/%{var}.yaml"]
# manifests/site.pp
node default {
  lookup('classes', Array[String[1]], 'unique', []).include
}

Add role names into hiera.

# %{::trusted.certname}.yaml
---
classes:
  - fakts

fakts::static:
  roles:
    - foo
    - bar

Hiera will search in the 'roles/foo.yaml' and 'roles/bar.yaml'

Reference

Class Fakts

Summary

Manages custom facts.

Overview

This class manages custom facts. Facts in the JSON format are stored into the directory '/etc/facter/facts.d' by default.

Examples

class { 'fakts':
  'static' => {
    'groups' => {
      'value' => [
        'foo',
        'bar',
      ],
    },
  },
}

Parameters

  • facts_d_dir (Stdlib::Absolutepath) (defaults to: '/etc/facter/facts.d') — A default facts directory.
  • static (Hash[String[1], Struct[{ ensure => Optional[Enum['absent', 'present']], value => Any, }]]) — Static facts.

Defined Type Fakts::Fakt

Summary

Manages a custom fact.

Overview

This resource manages custom fact.

Examples

fakts::fakt { 'namevar':
  ensure      => 'present',
  facts_d_dir => '/etc/facter/facts.d',
  value       => 'value',
}

Parameters

  • ensure (Enum['absent', 'present']) (defaults to: 'present') — Valid values are 'absent', 'present'.
  • facts_d_dir (Stdlib::Absolutepath) — An absolute path where a fact will be stored.
  • value (Any) (defaults to: undef) — A fact value.