Forge Home

facts_upload

Re-implements the puppet facts upload command and associated Puppet Server endpoint.

9,088 downloads

5,011 latest version

4.2 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

  • 1.1.0 (latest)
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0 (deleted)
released Nov 14th 2018
This version is compatible with:
  • Puppet Enterprise 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0 < 5.5.0
  • , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'sharpie-facts_upload', '1.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add sharpie-facts_upload
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install sharpie-facts_upload --version 1.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

Documentation

sharpie/facts_upload — version 1.1.0 Nov 14th 2018

Puppet Facts Upload

Build Status

This project re-implements the puppet facts upload command and part of the associated /puppet/v3/facts endpoint that was removed along with the inventory service in Puppet 4.0. These pieces of functionality were useful for keeping facts updated outside of catalog compilation.

Re-adding the command and endpoint enables two key use cases:

  • The ability to run agents off of cached catalogs. Facts become stale in this configuration as they are only updated when a fresh catalog is compiled.

  • The ability to submit updated facts at the end of an agent run. This allows facts to reflect any changes made during catalog application and keeps fact data as fresh as possible for PuppetDB queries.

Requirements

This module has been tested against the following versions of Puppet Server and Puppet Enterprise running on the following platforms:

  • Versions: Puppet Server 5.1.z and 5.2.z, PE 2017.3.z and PE 2016.4.10 -- PE 2016.4.z
  • Platforms: RedHat 6, 7; Ubuntu 14.04, 16.04; SLES 11, 12

The facts_upload module is fairly sensitive to the Puppet Server and PE version numbers as the code hooks into several internal APIs in both Puppet Server and the puppet_enterprise module. Installation of the Java plugins also requires manipulation of Puppet Server's Java classpath for versions older than Puppet Server 5 or PE 2017.3. The module likely will not work if your Puppet Server version or platform is not on the list above.

Puppet Agent support is much less restrictive. The module should work with Puppet versions 4.y and 5.y.

Usage

The facts_upload module currently provides one class: facts_upload::server. This class should be applied to all nodes running the puppetserver or pe-puppetserver services and will configure the Puppet Server to mount a /puppet/v3/facts endpoint and configures auth.conf to allow agents to upload facts for just their own certnames.

The module also provides some Ruby code which is pluginsynced to agents:

  • lib/puppet/indirector/facts/rest.rb
  • lib/puppet/feature/facts_upload_builtin.rb
  • lib/puppet/face/facts/upload.rb

Agents may run puppet facts upload once pluginsync has completed.

Limitations

This module only provides a subset of the functionality that was removed in PUP-2560:

  • A /puppet/v3/facts API endpoint for Puppet Server that responds to PUT requests only.

  • A Puppet::Node::Facts::Rest indirector terminus that sends requests from agents to the /puppet/v3/facts API endpoint of the server the agent is configured to talk with.

  • A puppet facts upload face that fetches facts from Facter and then uploads them to the /puppet/v3/facts API endpoint of the server the agent is configured to talk with.

Notably, the following deprecated features have not been restored:

  • Functionality and REST API routes related to the Inventory Service.

  • Functionality and indirector terminii related to the store_configs subsystem.

Development

See the output of rake -T for development workflow tasks. More info will be added to this section in a future release.