Você pode usar debug
para despejar a variável:
- name: this command prints FAILED when it fails
command: /usr/bin/example-command -x -y -z
register: command_result
failed_when: "'FAILED' in command_result.stderr"
- name: dump command_result
debug: var=command_result
Isso produzirá algo como:
TASK: [dump command_result] **************************************************************
ok: [hostname] => {
"command_result": {
"changed": false,
"cmd": "/usr/bin/example-command -x -y -z",
"delta": "0:00:00.018233",
"end": "2015-05-07 09:33:08.444674",
"invocation": {
"module_args": "/usr/bin/example-command -x -y -z",
"module_name": "command"
},
"rc": 0,
"start": "2015-05-07 09:33:08.426441",
"stderr": "",
"stdout": "whatever",
"stdout_lines": [
"whatever"
],
"warnings": []
}
}