Hey Florian,
Thanks for your support on this issue. I have meanwhile discovered that there is an alternative way to handle the output and format it to your liking by using callback plugins, here's a couple of good examples on how to use this feature: http://blog.cliffano.com/2014/04/06/human-readable-ansible-playbook-log-output-using-callback-plugin http://jpmens.net/2012/09/11/watching-ansible-at-work-callbacks It obviously has some drawbacks - such as one would need to reimplement the highlighting etc, but it's at least something to workaround the issue. Hope that helps. Best regards, Roman On Fri, Jan 9, 2015 at 3:24 AM, Florian Gysin <[email protected]> wrote: > *+ 1 for Romans issue.* > I also find the output of debug to be highly irritating and the missing > stdout_lines attribute on multi-item tasks void the only possible way of > getting human readable output. > On Thursday, February 20, 2014 10:48:20 PM UTC+1, Roman Revyakin wrote: >> >> Hi Michael, >> >> One of the pain points for us often times is the Ansible lack of the >> human-readable representability of the output of the task that has been >> run. A workaround up to now has been to use the `debug: >> var=output.stdout_lines` which while not perfect is at least more bearable >> in terms that one does not have to unwrap the '\n' into the new lines in >> his mind while reading the output: >> >> - name: post-deployment tasks executed >> local_action: shell cd tasks; ls >> when: cf_post_deployment_tasks is defined >> register: post >> tags: >> - post-deploy >> >> - debug: var=post.stdout_lines >> tags: >> - post-deploy >> >> TASK: [debug var=post.stdout_lines] >> ******************************************* >> ok: [localhost] => { >> "item": "", >> "post.stdout_lines": [ >> "cf_app_remap.yml", >> "cf_deployment.yml", >> "concat_files.yml", >> "npm_install.yml" >> ] >> } >> >> However, once a task is a multi-item one, the returned data structure >> lacks the `stdout_lines` attribute: >> >> - name: post-deployment tasks executed >> local_action: shell {{ item }} >> with_items: cf_post_deployment_tasks >> when: cf_post_deployment_tasks is defined >> register: post >> tags: >> - cf >> - post-deploy >> >> - debug: var=post >> tags: >> - post-deploy >> >> TASK: [debug var=post] >> ******************************************************** >> ok: [localhost] => { >> "item": "", >> "post": { >> "changed": true, >> "cmd": "cd tasks; ls ", >> "delta": "0:00:00.004343", >> "end": "2014-02-21 08:31:01.088304", >> "invocation": { >> "module_args": "cd tasks; ls", >> "module_name": "shell" >> }, >> "item": "", >> "rc": 0, >> "start": "2014-02-21 08:31:01.083961", >> "stderr": "", >> "stdout": >> "cf_app_remap.yml\ncf_deployment.yml\nconcat_files.yml\nnpm_install.yml", >> "stdout_lines": [ >> "cf_app_remap.yml", >> "cf_deployment.yml", >> "concat_files.yml", >> "npm_install.yml" >> ] >> } >> } >> >> Could you tell if it's something you would consider fixing if I create an >> issue on github? >> >> Thanks, >> >> With kind regards, >> Roman >> >> > -- > You received this message because you are subscribed to a topic in the Google > Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/Ucg4FeGTCmw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/dafd1a00-70d6-449c-8654-0ed2e653b586%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1420750244156.182fa01f%40Nodemailer. For more options, visit https://groups.google.com/d/optout.
