Is there a way with Ansible to print out a simple table style output. I've got the values I need registered to a variable in the playbook I just want to print it out more cleanly.
Currently the output I have with stdout.lines looks like this:
ok: [sage] => {
"voutput.stdout_lines": [
"4.4.5"
]
}
ok: [example] => {
"voutput.stdout_lines": [
"4.7"
]
}
But it'd be nice if I could get it formatted more like this:
sage 4.7
example 4.4.5
somethingelse 1.2.3
Is there any way to do something along those lines directly within Ansible, or do I just have to take the output it gives and transform it with something like AWK?
Best Answer
You can use standard json output callback and fetch required data with jq.
hosts:
playbook.yml:
execution: