Puppet Plan: complyadm::validate::runtime

Defined in:
plans/validate/runtime.pp

Overview

Validates that we have a runtime installed on all infrastructure targets.

Parameters:

  • config (Complyadm::Config) (defaults to: complyadm::config())

    Complyadm::Config object with all config options

Returns:

  • Hash returns pass/fail results from check



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'plans/validate/runtime.pp', line 8

plan complyadm::validate::runtime (
  Complyadm::Config $config = complyadm::config(),
) {
  $runtime = $config['runtime']

  $results = $config['roles'].reduce({ 'failed' => [], 'passed' => [] }) |$memo, $roles_hash| {
    $role = $roles_hash[0]
    $targets = $roles_hash[1]['targets']

    $runtime_results = complyadm::runtime::version($targets, $runtime)
    $passed_targets = $runtime_results.ok_set.map() |$result| {
      "${result.target.name} : found ${runtime}"
    } + $memo['passed']
    $failed_targets = $runtime_results.error_set.map() |$result| {
      "${result.target.name} : ${runtime} not found"
    } + $memo['failed']

    $memo + { 'passed' => $passed_targets.unique, 'failed' => $failed_targets.unique }
  }

  return $results
}