Sha256: 6c9e8a65e4f6536afa06d9985c22fb77f5b7360d0786f7eb22faebb086aa1491

Contents?: true

Size: 824 Bytes

Versions: 54

Compression:

Stored size: 824 Bytes

Contents

plan aggregate::nodes(
  Optional[String[0]] $task = undef,
  Optional[String[0]] $command = undef,
  Optional[String[0]] $script = undef,
  TargetSpec $nodes,
  Hash[String, Data] $params = {}
) {

  # Validation
  $type_count = [$task, $command, $script].reduce(0) |$acc, $v| {
    if ($v) {
      $acc + 1
    } else {
      $acc
    }
  }

  if ($type_count == 0) {
    fail_plan("Must specify a command, script, or task to run", 'aggregate/invalid-params')
  }

  if ($type_count > 1) {
    fail_plan("Must specify only one command, script, or task to run", 'aggregate/invalid-params')
  }

  $res = if ($task) {
    run_task($task, $nodes, $params)
  } elsif ($command) {
    run_command($command, $nodes, $params)
  } elsif ($script) {
    run_script($script, $nodes, $params)
  }

  return aggregate::nodes($res)
}

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
bolt-2.44.0 modules/aggregate/plans/nodes.pp
bolt-2.42.0 modules/aggregate/plans/nodes.pp
bolt-2.40.2 modules/aggregate/plans/nodes.pp
bolt-2.40.1 modules/aggregate/plans/nodes.pp
bolt-2.38.0 modules/aggregate/plans/nodes.pp
bolt-2.37.0 modules/aggregate/plans/nodes.pp
bolt-2.36.0 modules/aggregate/plans/nodes.pp
bolt-2.35.0 modules/aggregate/plans/nodes.pp
bolt-2.34.0 modules/aggregate/plans/nodes.pp
bolt-2.33.2 modules/aggregate/plans/nodes.pp
bolt-2.33.1 modules/aggregate/plans/nodes.pp
bolt-2.32.0 modules/aggregate/plans/nodes.pp
bolt-2.31.0 modules/aggregate/plans/nodes.pp
bolt-2.30.0 modules/aggregate/plans/nodes.pp
bolt-2.29.0 modules/aggregate/plans/nodes.pp
bolt-2.28.0 modules/aggregate/plans/nodes.pp
bolt-2.27.0 modules/aggregate/plans/nodes.pp
bolt-2.26.0 modules/aggregate/plans/nodes.pp
bolt-2.25.0 modules/aggregate/plans/nodes.pp
bolt-2.24.1 modules/aggregate/plans/nodes.pp