在Ansible中,我使用的是json查询和循环。 当“contentId”为“2565845434839sdsfc9we”时,我想获取“controllerKey”。 试了好几件事,似乎都不管用。有可能吗?你知道吗
result": {
"hardware": {
"_vimtype": "vim.vm.VirtualHardware",
"device": [
{
"_vimtype": "vim.vm.device.VirtualDisk",
"backing": {
"contentId": "2565845434839sdsfc9we",
"writeThrough": false
},
"controllerKey": 1000,
},
{
"_vimtype": "vim.vm.device.VirtualDisk",
"backing": {
"contentId": "5264578434839sdsfc9rt",
"writeThrough": false
},
"controllerKey": 1001,
}
],
"memoryMB": 16384,
"numCPU": 2,
"numCoresPerSocket": 1,
"virtualICH7MPresent": false,
"virtualSMCPresent": false
}
下面的任务
给予
也可以迭代查询。下面的任务
给予
相关问题 更多 >
编程相关推荐