fakts

contributions requested
pdk
Manages facts

6,881 downloads

5,599 latest version

5.0 quality score

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

  • 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
  • CentOS
    ,
    OracleLinux
    ,
    RedHat
    ,
    Scientific
    ,
    Debian
    ,
    Ubuntu
    ,
    Fedora

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.