Forge Home

annotation

Add annotation metaparameter to document purpose, owner, or other metadata elements of any resource.

1,250 downloads

1,155 latest version

5.0 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.1.1 (latest)
  • 0.1.0
released May 14th 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, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • , , , , , , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'reidmv-annotation', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add reidmv-annotation
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install reidmv-annotation --version 0.1.1

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

reidmv/annotation — version 0.1.1 May 14th 2020

annotation

Description

This module adds an extra Puppet metaparameter for the purpose of recording high-level or human-readable annotations about what classes or resources are for. This information can be used to automatically generate human-readable reports either of what work Puppet has performed on a system or of all the content Puppet is managing on a system, and why.

Usage

Put this in site.pp to enable annotation

annotation::enable()

Use the annotation metaparameter as needed on resources

notify { 'example':
  message    => 'this is a notify resource',
  annotation => 'this is an annotation for it',
}

file { '/tmp/example.conf':
  ensure     => file,
  owner      => 'root',
  annotation => {
    'description' => 'Annotations do not need to be strings',
    'product'     => 'Example Product',
    'owner'       => 'Kelly',
  },
}

To annotate classes, either declare them resource-style, or use the annotation() function. Note that the two methods of annotating are mutually exclusive.

class example {
  annotation('This is an annotation declared IN the example class')
}

An annotation set in a resource-style class parameter declaration will override the annotation set using annotation() inside the class.

class { 'example':
  annotation => 'This annotation will override the other one',
}

Querying

To query for all annotated resources on a node, use a PuppetDB PQL query such as the following.

resources { certname = "example.node.tld" and parameters.annotation is not null }