【发布时间】:2019-10-09 07:48:34
【问题描述】:
我正在使用 vmware_host_vmhba_facts 模块,我的目标是为任何 esx 提取 hbas 的状态。
我附上一个简短的输出:
PLAY [Check HBA status] **********************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] ***********************************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [Gather facts about vmhbas of all ESXi Host in the given Cluster] ***********************************************************************************************************************************************************************
ok: [localhost -> localhost]
TASK [debug] *********************************************************************************************************************************************************************************************************************************
ok: [localhost] => {
"cluster_host_vmhbas": {
"changed": false,
"failed": false,
"hosts_vmhbas_facts": {
"ita-esx01.net": {
"vmhba_details": [
{
"adapter": "Intel Corporation Lewisburg SATA AHCI Controller",
"bus": 0,
"device": "vmhba38",
"driver": "ahci",
"location": "0000:00:11.5",
"model": "Lewisburg SATA AHCI Controller",
"status": "unknown",
"type": "BlockHba"
},
{
"adapter": "QLogic Corp 2600 Series 16Gb Fibre Channel to PCI Express HBA",
"bus": 95,
"device": "vmhba3",
"driver": "qlnativefc",
"location": "0000:5f:00.0",
"model": "2600 Series 16Gb Fibre Channel to PCI Express HBA",
"node_wwn": "23:06:11:22:94:35:05:46:63",
"port_type": "unknown",
"port_wwn": "23:06:39:37:69:32:72:57:29",
"speed": 16,
"status": "online",
"type": "Fibre Channel"
}
]
},
"ita-esx02.net": {
"vmhba_details": [
{
"adapter": "Intel Corporation Lewisburg SATA AHCI Controller",
"bus": 0,
"device": "vmhba38",
"driver": "ahci",
"location": "0000:00:11.5",
"model": "Lewisburg SATA AHCI Controller",
"status": "unknown",
"type": "BlockHba"
},
{
"adapter": "QLogic Corp 2600 Series 16Gb Fibre Channel to PCI Express HBA",
"bus": 95,
"device": "vmhba4",
"driver": "qlnativefc",
"location": "0000:5f:00.1",
"model": "2600 Series 16Gb Fibre Channel to PCI Express HBA",
"node_wwn": "23:06:11:22:94:35:05:46:64",
"port_type": "unknown",
"port_wwn": "23:06:39:37:69:32:72:57:30",
"speed": 16,
"status": "online",
"type": "Fibre Channel"
},
在这个输出之后,我想要一个类似的输出:
ita-esx01.net:
vmhba38 status unknown
vmhba3 status online
ita-esx02.net:
vmhba38 status unknown
vmhba4 status online
你有什么提示吗? 谢谢
【问题讨论】:
-
我认为您将不得不自己解析调试 JSON。
标签: ansible vmware ansible-facts