Forge Home

task_series

Utility plan to intelligently run a series of tasks and report back on the outcome.

3,907 downloads

3,907 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.0 (latest)
released May 24th 2019
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
  • , , , , , , , , , ,
Tasks:
  • test
Plans:
  • task_series
  • test

Start using this module

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

Add this module to your Puppetfile:

mod 'reidmv-task_series', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install reidmv-task_series --version 0.1.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

reidmv/task_series — version 0.1.0 May 24th 2019

task_series

Utility plan to intelligently run a series of tasks and report back on the outcome.

Table of Contents

  1. Description
  2. Usage

Description

This module provides a Bolt plan which runs a series of tasks on specified targets. After each individual task completes, targets which did not complete that task successfully are set aside, and the next task in the series is run only on those targets on which the task succeeded. At the end, a summary of the series result is presented, along with the ResultSets for each step in the task series.

The summary will show which targets succeeded, as well as which targets failed and at which step.

Usage

Example usage:

plan task_series::test (
  TargetSpec $nodes = ['ssh://faketarget', 'local://willfailtest', 'local://1', 'local://2'],
) {
  $targets = get_targets($nodes)

  $series_result = run_plan('task_series',
    nodes => $targets,
    tasks => [
      [ 'task_series::test',
          exit_code => 0,
      ],
      [ 'task_series::test',
          exit_code => 0,
      ],
      [ 'task_series::test',
          exit_code => 0,
      ],
    ],
  )

  return($series_result[summary])
}

Example return value:

{
  "errored at step 0: validate connection": [
    "ssh://faketarget"
  ],
  "errored at step 1: task_series::test": [
    "local://willfailtest"
  ],
  "succeeded": [
    "local://1",
    "local://2",
    "local://3"
  ]
}