File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 11# Starts a Puppet agent run on the specified targets.
22# Note: This plan may cause issues when run in Puppet Enterprise.
33# @param targets The targets to start a Puppet agent run on.
4+ # @param noop if true, all runs will use --noop
5+ # @param environment the desired puppet code environment
46plan puppet_agent::run (
5- TargetSpec $targets
7+ TargetSpec $targets ,
8+ Boolean $noop = false ,
9+ Optional[String[1]] $environment = undef ,
610) {
711 # Check which targets have the agent installed by checking
812 # the version of the agent. No point in trying to run the
5357 }
5458
5559 # Run the agent on all targets that have the agent installed.
60+ $arg_env = $environment ? {
61+ Undef => {},
62+ default => {' environment' => $environment , },
63+ }
64+ $arg_noop = $noop ? {
65+ true => { ' noop' => true , },
66+ default => {},
67+ }
68+ $args = $arg_env + $arg_noop + {' _catch_errors' => true }
5669 $run_results = run_task(
5770 ' puppet_agent::run' ,
5871 $agent_results .targets,
5972 ' Run Puppet agent' ,
60- ' _catch_errors ' => true
73+ $args ,
6174 )
6275
6376 # Merge all of the results into a single ResultSet so each
You can’t perform that action at this time.
0 commit comments