Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orchestrator manipulates task output #27

Open
bastelfreak opened this issue Apr 16, 2024 · 1 comment
Open

Orchestrator manipulates task output #27

bastelfreak opened this issue Apr 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bastelfreak
Copy link

Describe the Bug

The orchestrator manipulates the result/output from tasks. I was told the best practice is to use json output. That's also what the majority of the Puppet tasks do. When executed on the CLI via puppet task run several characters are stripped:

# puppet task run facts --nodes=puppet
Starting job ...
Note: The task will run only on permitted nodes.
New job ID: 16
Nodes: 1

Started on puppet ...
-
|

Finished on node puppet
  staging_http_get : curl
  pe_minor_version : 7
  processor2 : AMD EPYC Processor
  mtu_eth0 : 1500
  network6_eth0 : 2a01:4f8:1c17:71b6::
...

I think that makes the output harder to read and impossible to parse, because the output is unpredictable. The PE console displays the data less manipulated, but still manipulated:

2024-04-16_15-12

There is whitespace injected before each :. While this is still valid JSON, it looks quite odd and this representation doesn't seem to be common. Also as I user I wouldn't expect that the output is manipulated.

Expected Behavior

Display the task output in the original form, without manipulation. As this would be a breaking change for the CLI, I would be fine with another value for --format, like --format=original.

Steps to Reproduce

  • run any task via puppet task run

Environment

  • PE 2021
  • PE 2023

Additional Context

This is a followup of a slack discussion from yesterday (2024-04-15)

@bastelfreak bastelfreak added the bug Something isn't working label Apr 16, 2024
@Sharpie
Copy link
Member

Sharpie commented Apr 23, 2024

The puppet task command defaults to --format human which tries to display the output in a form that is easier for humans to read.

For machine parsable output, use: puppet task run --format json ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants