This message was deleted.
# puppet-enterprise
s
This message was deleted.
j
Hey Bob. 😄 I don't have an answer, just saying Hi!
t
you can use a variable as the result for run_command and then make decisions on what to do with the result. https://puppet.com/docs/bolt/latest/writing_plans.html#handling-plan-function-results
r
@tuxmea -- Yeah, I'm capturing the output in a variable, but the plaintext is still showing up.
I'm doing something like this:
$myvar = String(Binary(run_command('mycommand', $target).to_data[0]['value']['stdout'], '%s'))
Unfortunately, the plaintext output of
mycommand
is showing up in the plan run log.
t
In this case you want to not use run_command, but run_task and add sensitive data as sensitive parameters. Within the task you can then build the plaintext command
what I understood: you want the command to not be shown in plan text?
or do you want to show the result not in plan text?
r
I want to pass the result to a task, and not show it in the run logs at all.
It's not the text of
mycommand
that needs hiding; it's the stdout result.
t
You can try to pass the catch_error option to run_command. AFAIK this prevents the direct output as you want to deal with the data afterwards. https://puppet.com/docs/bolt/latest/plan_functions.html#run-command
r
Thanks; I'll try that.
Damn; didn't work.