Version information
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
Add this module to your Puppetfile:
mod 'bibigon812-fakts', '1.0.0'
Learn more about managing modules with a PuppetfileDocumentation
bibigon812/fakts — version 1.0.0 Jul 2nd 2018
fakts
This module manages facts via files.
Table of Contents
- Description
- Usage - Configuration options and additional functionality
- 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.
Changelog
All notable changes to this project will be documented in this file.
Unreleased
Fixed
- The artifact mask matches a package in the pipeline stage 'build'.
1.0.0 - 2018-07-02
Added
- The configuration example with roles using this module.
- The fakt class creates $facts_d_dir if it is absent.
0.2.0 - 2018-06-26
Added
- The fact value may be missing if the fact is removing.
Fixed
- Multiple fact variables can be used.
0.1.2 - 2018-06-26
Fixed
- Hiera lookup_options.
0.1.1 - 2018-06-26
Added
- Hiera v5 default values.
- Tags in metadata.json.
Fixed
- the README file has a valid title.
0.1.0 - 2018-06-25
Added
- Initial classes and resources.
Dependencies
- puppetlabs-stdlib (>= 4.10.0 < 6.0.0)