Forge Home

flagpole

This is a simple module to verify that puppet is correctly managing a resource on a given host: "Hoist it up the flagpole and see who salutes"

7,128 downloads

6,981 latest version

1.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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Jan 30th 2017

Start using this module

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

Add this module to your Puppetfile:

mod 'geoffwilliams-flagpole', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add geoffwilliams-flagpole
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install geoffwilliams-flagpole --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

geoffwilliams/flagpole — version 0.1.1 Jan 30th 2017

Build Status

flagpole

Table of Contents

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

Description

This is a simple module to verify that puppet is correctly managing a resource on a given host: "Hoist it up the flagpole and see who salutes".

When the flagpole module is active on a node, it will create a file at /tmp/flagpole that contains the time the catalogue was generated. This will be updated on each Puppet run.

The module ships with a custom fact flagpole that indicates when flagpole was last run. If flagpole has never been run on this node (or the file it creates has been removed) the date indicated will be "never".

Setup

What flagpole affects

  • Creates a file at /tmp/flagpole to indicate that the module has been active on this node at some time
  • Ships a custom fact flagpole to give visibility to the above file

Usage

To use flagpole, install the module and include the main class:

include flagpole

Alternatively, you could add flagpole to the classes tab for a given group using the Node Classifer. Node Classifier

You can then see if a node will be classified to include flagpole on its next run by looking at a given node's classes tab: Classification

Finally, after puppet has run, you can check the value of the flagpole fact for the node your interested in. You should see a timestamp within 30 minutes of the current time which indicates that the class was active recently: Inventory

Reference

Classes

  • flagpole - Install the flagpole file

Facts

  • flagpole - Interpret the flagpole file

Limitations

  • Requires write access to /tmp/flagpole, so only work on Unix OS's for the moment
  • You must run puppet twice on a given node for the console to display the correct time of update. This is because Facts are executed at the beginning of the Puppet run when the file at /tmp/flagpole has not yet been created so cannot be reported. After the initial run creating the file, the fact will be accurate. Alternatively, you could SSH into the node in question and check for the file manually or look at the log messages in the console from a given Puppet run which will show the file being updated.

Development

PRs Accepted :)

Testing

This module supports testing using PDQTest.

Test can be executed with:

bundle install
bundle exec pdqtest all

See .travis.yml for a working CI example