Forge Home

puppetstats

Enables anonymous usage statistics for puppet modules. A service provided by puppetstats.com.

8,459 downloads

2,454 latest version

4.9 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.5.0 (latest)
  • 0.4.0
  • 0.3.0
  • 0.2.0
  • 0.1.0
released Mar 22nd 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0 < 7.0.0
  • , , , , , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'kschu91-puppetstats', '0.5.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add kschu91-puppetstats
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install kschu91-puppetstats --version 0.5.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

kschu91/puppetstats — version 0.5.0 Mar 22nd 2020

puppetstats

Build Status Puppet Forge Puppet Forge - downloads Puppet Forge - scores

Table of Contents

  1. Description
  2. Setup - The basics of getting started with puppetstats
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Testing when using puppetstats
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Description

Have you every ask yourself how many systems are using your puppet module in a specific puppet version or on a specific distribution? This is exactly what puppetstats.com and this module is build for.

This module enables the free service from puppetstats.com that allows you to analyse anonymous usage statistics of your puppet modules. This can help you to optimize your module based on the usage.

Note: To opt-out completely from puppetstats with your system just follow the opt-out guide.

Setup

What puppetstats affects

The module will send anonymous usage statistics to puppetstats.com. You can sign up for free at puppetstats.com to view and analyse the usage statistics of your modules.

Beginning with puppetstats

To get started just call the puppetstats module together with the full qualified module name of your puppet module. Eg. puppetlabs-apache.

puppetstats { 'puppetlabs-apache': }

After including the puppetstats module into your module, simply go to puppetstats.com and register your module. You can also have a look into the getting started guide.

Usage

The common way of including puppetstats in your puppet module, is to give your module users the ability to disable puppetstats if they want to.

class yourfancymodule (
  Boolean $enable_puppetstats = true,
) {
  
  ...
  
  puppetstats { 'puppetlabs-apache': enabled => $enable_puppetstats }
  
  ...
  
}

Note: To disable puppetstats system wide, just follow the opt-out guide.

Reference

enabled

puppetstats { 'puppetlabs-apache': enabled => false}

Which allows you to disable the tracking of statistics. This parameter is useful if you want to give the users of your module the ability to disable puppetstats statistics. For example:

class yourfancymodule (
  Boolean $enable_puppetstats = true,
) {
  
  ...
  
  puppetstats { 'puppetlabs-apache': enabled => $enable_puppetstats }
  
  ...
  
}

Testing when using puppetstats

Unit Tests

Simply define a new type under the pre_condition.

let(:pre_condition) { "define puppetstats($enabled) {}" }

A working example can be found in the kschu91-gogs module.

Functional/Acceptance Tests

In functional or acceptance tests you should set the puppetstats_disabled fact, which prevents puppetstats from creating statistics with your tests.

let(:facts) {{:puppetstats_disabled => true}}

A working example can be found in the kschu91-gogs module.

Limitations

The puppetstats module should work on each OS and distribution where puppet is running. It has very minimum dependencies and is mostly written in native ruby.

Development

If you find any defects or want to raise a feature request, create an issue on Github and let me know.