kschu91-puppetstats


Keywords
statistics, analytics, data, tracking
License
Apache-2.0
Install
puppet module install kschu91-puppetstats --version 0.5.0

Documentation

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.