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

Document how to use the yaml stdout_callback plugin #212

Closed
varac opened this issue Feb 20, 2019 · 1 comment
Closed

Document how to use the yaml stdout_callback plugin #212

varac opened this issue Feb 20, 2019 · 1 comment

Comments

@varac
Copy link

varac commented Feb 20, 2019

The main issue I have with ansible-runner is that it is using the default ansible stdout_callback, which is horrible to parse (as human) when it comes to multi-line failures like:

Feb 14 13:15:51     "installTiller.stdout": "serviceaccount/tiller created\nclusterrolebinding.rbac.authorization.k8s.io/tiller-clusterrolebinding created\n$HELM_HOME has been configured at /root/.helm.\n\nTiller (the Helm server-side component) has been installed into your Kubernetes Cluster.\n\nPlease note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.\nTo prevent this, run `helm init` with the --tiller-tls-verify flag.\nFor more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation\nHappy Helming!\nWaiting for deployment \"tiller-deploy\" rollout to finish: 0 of 1 updated replicas are available...\ndeployment \"tiller-deploy\" successfully rolled out"

With ansible-playbook, using stdout_callback = yaml gives a much cleaner output. But I can't find a way of using this callback plugin in ansible-runner. Is there a way ?
Same question goes for callback_whitelist = profile_tasks, timer which are the other callbacks we'd like to use.

@matburt
Copy link
Member

matburt commented Feb 20, 2019

We do have a json output mode:

https://ansible-runner.readthedocs.io/en/latest/standalone.html#outputting-json-raw-event-data-to-the-console-instead-of-normal-output

Which is also available as on the module interface. I feel like we can probably add a yaml mode to that also.

Runner itself uses a callback to drive its event collections which can cause issues if it's removed as the callback plugin. You can probably add others without much issue but you'll need to do it from the environment variable or ansible.cfg.

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

No branches or pull requests

2 participants