Giter VIP home page Giter VIP logo

puppet-retrypuppet's Introduction

retrypuppet

Build Status Coverage GitHub Issues Puppet Forge Version Puppet Forge Downloads Maintained by AO Labs

Table of Contents

  1. Description
  2. Usage
  3. Contributors
  4. ChangeLog

Description

Provides a simple python based wrapper script around puppet agent to automatically retry in the event that a run is already in progress.

Where the puppet agent is polling at a high frequency, whether in "apply" mode or "noop" mode for audit purposes, it is likely that any manual agent run will clash with the agent already running in the background. This can be especially irritating where an orchestration tool such as mCollective or Salt is used to run puppet - perhaps as part of a deployment process.

# puppet agent -tv
Notice: Run of Puppet configuration client already in progress; skipping  (/opt/puppetlabs/puppet/cache/state/agent_catalog_run.lock exists)

Usage

Add the below to your manifests for any machine on which you want to run puppet agent:

class { '::retrypuppet': }

Then simply use the retrypuppet wrapper script in place of the puppet binary. The script passes any arguments specified on its command-line directly to the puppet binary, passes any output from the puppet binary on its standard output (note that any agent output to stderr will be flattened to stdout), and will return Puppet's returncode as its returncode. If the agent returns a notice that a run is already in progress, then retrypuppet will wait for a 30 second back-off period before trying again. After 10 "blocked" attempts, retrypuppet will exit returning 11 (EAGAIN). To reduce noise, retrypuppet will not display any output from a blocked run other than a notice.

# retrypuppet agent -tv
Run already in progress, will retry in 30 seconds, 9 attempts remain...
Run already in progress, will retry in 30 seconds, 8 attempts remain...
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for centos-puppet.localdomain
Info: Applying configuration version '1488412377'
Notice: Applied catalog in 1.14 seconds

Contributors

Original module authored by Patrick Brennan and released under the LGPLv3 license courtesy of Hapara LLC. Ongoing maintenance by AO Labs courtesy of Patrick Brennan.

ChangeLog

  • 1.1.0 Documentation updates, Travis-CI test integration, return puppet's return code (issue #45).
  • 1.0.1 Support Python 2 and 3.
  • 1.0.0 Initial release, Python 3 only.

puppet-retrypuppet's People

Contributors

bsdfirst avatar

Watchers

 avatar

Forkers

bsdfirst

puppet-retrypuppet's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.