You'll have to use the localhost target inside a loop in a plan for that.

get_targets($targets).each |$t| {
   run_script('myscript', 'localhost', arguments => [ $t.host ])
}

If you convert the script into a task you can use run_task_with to
parallelize it but it's probably easier to just write a task or script that
accepts an array of host names.

# create a special local target for each remote host.
$local_targets = get_targets($targets).map |t| {
get_target("local://$t.host") }
# use run_task_with to execute against all of these against localhost
run_task_with(mytask, $local_targets) |$t| {
  { 'host' => $t.host }
}

On Fri, Aug 7, 2020 at 9:24 AM Chris Edwards <offlin...@gmail.com> wrote:

> Not sure if this is the correct place to post this question but I'll do it
> anyway....
>
> Hi!  I am trying to have Bolt run a script on my laptop for each target.
> I don't want to execute a script on the target.   Obviously I am fairly new
> to Bolt.  Any help is appreciated.
>
> Thanks,
>
> Chris Edwards
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/fb0c2bc4-36f6-457b-b804-e798f7f0f81bo%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/fb0c2bc4-36f6-457b-b804-e798f7f0f81bo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMahoJtjxQ3XL6UJD5yq1ENZiLn9VPu0RVeDbtdXuypCoBbtdQ%40mail.gmail.com.

Reply via email to