puppetstats
Version information
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
Add this module to your Puppetfile:
mod 'kschu91-puppetstats', '0.5.0'
Learn more about managing modules with a PuppetfileDocumentation
puppetstats
Table of Contents
- Description
- Setup - The basics of getting started with puppetstats
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Testing when using puppetstats
- Limitations - OS compatibility, etc.
- 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.
2018-09-22 Release 0.4.0
- Bugfix: Do not show warnings anymore when module is disabled
- Bugfix: Now fail silently when sommething went wrong, before puppet crashed with an error for example when HTTP calls are running into a timeout
- Bugfix: Fixes tests so that they are using the correct puppetversions
- Remove support for puppet 2.7.0 and 3.8.0 - it has never worked anyways
2018-03-25 Release 0.3.0
- Feature: Added differentiation for serverless vs. master puppet runs
- Feature: Generate unique system hash based on puppet server name and node name, if not in serverless mode
- Improvement: More resilient behaviour if no version is present
- Improvement: Optimize notices and warnings
- Removed parameter full_qualified_module_name
2018-03-24 Release 0.2.0
Feature: support for opt-out with puppetstats_disabled
fact, which allows to disable puppetstats on a whole server/environment/node
2018-03-19 Release 0.1.0
First release supporting basic statistic gathering.
Dependencies
- puppetlabs-stdlib (>= 1.0.0)