Forge Home

augeasfacter

Camptocamp AugeasFacter Module

12,192 downloads

11,805 latest version

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

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

  • 0.1.0 (latest)
  • 0.0.1
released Dec 4th 2012

Start using this module

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

Add this module to your Puppetfile:

mod 'camptocamp-augeasfacter', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add camptocamp-augeasfacter
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install camptocamp-augeasfacter --version 0.1.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: facter, augeas

Documentation

camptocamp/augeasfacter — version 0.1.0 Dec 4th 2012

augeasfacter, a Facter plugin to dynamically declare facts using Augeas

This is a Facter plugin to dynamically declare facts using Augeas, without using a single line of code.

Using outside of Puppet

This plugin does not strictly depend on Puppet. If you want to use it outside of Puppet, simply copy lib/facter/augeasfacter.rb in your FACTERLIB directory and use /etc/augeasfacter.conf (or the value of the AUGEASFACTER_CONF environment variable) as the configuration file for new facts.

Using in Puppet

When used inside Puppet, the plugin will still load facts defined in /etc/augeasfacter.conf. However, it will also allow you to deploy facts using pluginsync.

In order to do so, simply create .conf files in the lib/augeasfacter/ directory of your modules:

{modulepath}
└── {module}
    └── lib
        └── augeasfacter
            ├── foo.conf
            └── bar.conf

Puppet will automatically sync the augeasfacter directory into its :libdir directory and augeasfacter will start using the declared facts immediatly.

Fact declaration

The configuration files (whether /etc/augeasfacter.conf or configuration files in {module}/lib/augeasfacter/ are INI files, similar to puppet.conf.

Simple value

Here is an example of a simple fact:

[augeasversion]
path = /augeas/version

When querying facter for the augeasversion fact, it will output the value of the /augeas/version node in the Augeas tree.

Simple labels

If you need to retrieve a node label rather than its value, you can use method = label:

[user_1000]
path   = /files/etc/passwd/*[uid="1000"]
method = label

will output the name of the user with uid 1000.

Lists

You can also concatenate several values with a separator:

[users]
type   = multiple
path   = /files/etc/passwd/*
sep    = :
method = label

will output the list of all users in /etc/passwd, concatenated with :.

See examples/augeasfacter.conf for a sample configuration file.

Loading a specific lens

As with any Augeas-based tool, one might use a given lens on a specific file without having to modify the standard include statements of the lens. In order to achieve this, you can add lens and incl parameters to any fact, just as you would with the augeas type in Puppet:

[json_entry]
path = example.json/dict/entry[8]
lens = Json.lns
incl = /example.json

This will associate /example.json to the Json.lns lens before doing the query on path. Note that relative paths as used here will only work with Augeas 0.10.0 or greater, since /augeas/context is defined to /files by default in these versions.

Issues

Please file any issues or suggestions on GitHub.