Forge Home

puppet_agent_cleanser

Use MCollective to clean the state of your Puppet agents

5,874 downloads

5,630 latest version

4.1 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

  • 1.0.0 (latest)
  • 0.1.0
released Jun 21st 2017

Start using this module

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

Add this module to your Puppetfile:

mod 'jesse-puppet_agent_cleanser', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jesse-puppet_agent_cleanser
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jesse-puppet_agent_cleanser --version 1.0.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

jesse/puppet_agent_cleanser — version 1.0.0 Jun 21st 2017

puppet_agent_cleanser

Table of Contents

  1. Description
  2. Usage
  3. Limitations
  4. Development

Description

This Puppet module installs an MCollective application and agent for cleaning up the state of your running Puppet agents should they become stuck for whatever reason (eg a rogue firewall stole your TCP state and left your Puppet agents with half-open connections to the master.)

Setup

By default, including the puppet_agent_cleanser class will install both the MCollective Agent and Application. If you want to be more selective you can disable one or other, eg:

class { 'puppet_agent_cleanser':
  include_app   => false,
  include_agent => true,
}

Usage

Obtaining status of one (or more) machines: mco puppet_agent_cleanser status

If number of agent processes is more than 1 for an extended period then it's likely the forked child process of the agent has hung, as seen below.

Eg:

$ mco puppet_agent_cleanser status -I foo.example

 * [ ============================================================> ] 1 / 1


foo.example
   Puppet Agent Status: 2 process.



Finished processing 1 / 1 hosts in 1087.47 ms

We can now target this machine to have its Puppet agent cleanly restarted (including killing of any stuck child processes and deletion of the agent catalog run lockfile) by running mco puppet_agent_cleanser cleanse

Eg:

$ mco puppet_agent_cleanser cleanse -I foo.example

 * [ ============================================================> ] 1 / 1


foo.example
   Cleanse result: success



Finished processing 1 / 1 hosts in 19230.85 ms

Limitations

This has been developed with Linux agents in mind. It should work on any UNIX type OS but has only been tested on RHEL 6 to date. It will need a bit of work to get working on Windows due to pathing assumptions.

Development

Pull requests welcome! Raise an issue if you want to discuss a possible feature addition, report a bug, etc.