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

use stdout_callback to make ansible errors human readable #293

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

msherman64
Copy link
Contributor

Ansible's stdout defaults to a very dense, minimal format that is not particularly readoable. (e.g. giant blob of multiline json)

As of ansible 2.5, a human readable callback plugin (yaml) is built-in, and can be specified in ansible.cfg via stdout_callback = yaml.

Potential other options are unixy, dense, or debug. A full list can be found here: https://docs.ansible.com/ansible/latest/collections/callback_index_stdout.html

For more examples, see this blog post:
https://www.jeffgeerling.com/blog/2018/use-ansibles-yaml-callback-plugin-better-cli-experience

Ansible's stdout defaults to a very dense, minimal format that is not particularly readoable.
(e.g. giant blob of multiline json)

As of ansible 2.5, a human readable callback plugin (`yaml`) is built-in, and can be specified in
ansible.cfg via `stdout_callback = yaml`.

Potential other options are `unixy`, `dense`, or `debug`.
A full list can be found here: https://docs.ansible.com/ansible/latest/collections/callback_index_stdout.html

For more examples, see this blog post:
https://www.jeffgeerling.com/blog/2018/use-ansibles-yaml-callback-plugin-better-cli-experience
Copy link
Contributor

@JOUNAIDSoufiane JOUNAIDSoufiane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ansible 2.5+ by default the version that is used in chi-in-a-box? when I tried this flag on dev-in-a-box, it did fix the weird yaml error output

@msherman64
Copy link
Contributor Author

Is ansible 2.5+ by default the version that is used in chi-in-a-box? when I tried this flag on dev-in-a-box, it did fix the weird yaml error output

Yes

ansible>=2.10,<5

xena is using >= 2.10

@msherman64 msherman64 merged commit 50490c3 into stable/xena Jun 27, 2024
1 check passed
@msherman64 msherman64 deleted the wip/improve_ansible_errors branch June 27, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants