Hi,
I have this piece of yaml playbook:
-
name: get read block device such /dev/sdX
shell: “readlink -f /dev/disk/by-id/google-{{ item.block }}”
with_items: mounts
register: device -
debug: var=device.results
Trying to get the read “sd” device from a symlink.
the output of device.results is:
ok: [ygtest] => {
“var”: {
“device.results”: [
{
“changed”: true,
“cmd”: “readlink -f /dev/disk/by-id/google-local-ssd-0”,
“delta”: “0:00:00.003578”,
“end”: “2015-05-07 08:56:24.201753”,
“invocation”: {
“module_args”: “readlink -f /dev/disk/by-id/google-local-ssd-0”,
“module_name”: “shell”
},
“item”: {
“block”: “local-ssd-0”
},
“rc”: 0,
“start”: “2015-05-07 08:56:24.198175”,
“stderr”: “”,
“stdout”: “/dev/sdb”,
“stdout_lines”: [
“/dev/sdb”
],
“warnings”:
}
]
}
}
How can I access the “stdout” value? I need the output of “/dev/sdb”
Thanks.