structured_facts

Parses JSON encoded facts into Puppet data structures
Ben Ford

Ben Ford

binford2k

9,650 downloads

4,906 latest version

4.0 quality score

Version information

  • 0.0.3 (latest)
  • 0.0.2
  • 0.0.1
released Jul 3rd 2019

Start using this module

Tags: facts

Documentation

binford2k/structured_facts — version 0.0.3 Jul 3rd 2019

Introduction

Deprecation notice:

This module is only of use for historical reasons and for older Puppet releases. Puppet has included native structured facts for several years now. If you are anywhere near current, please use those instead!

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.