Sha256: 7996775e6537c55ef0b06d52bfbd55ace771b69553a306cf5366f00c290e9032

Contents?: true

Size: 835 Bytes

Versions: 54

Compression:

Stored size: 835 Bytes

Contents

plan aggregate::targets(
  Optional[String[0]] $task = undef,
  Optional[String[0]] $command = undef,
  Optional[String[0]] $script = undef,
  TargetSpec $targets,
  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, $targets, $params)
  } elsif ($command) {
    run_command($command, $targets, $params)
  } elsif ($script) {
    run_script($script, $targets, $params)
  }

  return aggregate::targets($res)
}

Version data entries

54 entries across 54 versions & 1 rubygems

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