Forge Home

structured_facts

Parses JSON encoded facts into Puppet data structures

10,764 downloads

851 latest version

4.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

  • 0.0.4 (latest)
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Jan 19th 2021
This module has been deprecated by its author since Jan 19th 2021.

The reason given was: Obsoleted by core functionality. See https://puppet.com/docs/puppet/latest/custom_facts.html

Start using this module

Tags: facts

Documentation

binford2k/structured_facts — version 0.0.4 Jan 19th 2021

Introduction

Deprecation notice:

You should not use this module. It's many years obsolete. Puppet has included native structured facts for several years now.

See https://puppet.com/docs/puppet/update/custom_facts.html for information on updating your facts.

Structured Facts

This simply parses JSON encoded facts into Puppet data structures and exposes them as global variables. It doesn't provide any functionality on its own. You have to write custom facts for it to parse.

Three sample facts are included:

  • mounts
    • Exposes a hash of mountpoints and filesystem stats
  • ipaddresses
    • Exposes a hash of IP addresses keyed off interface names
  • interfaces_array
    • Just like built-in interfaces fact, but an array instead of a string

Usage

  1. Put this module in your modulepath.
  2. Add a call to decode_structured_facts() near the top of site.pp
  3. Write custom facts that return JSON. Prepend encoded_ to your fact names.

Limitations

  • It does very little error checking.

Contact

License

Copyright (c) 2013 Puppet Labs, info@puppetlabs.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.