【发布时间】:2020-02-08 12:39:09
【问题描述】:
我有以下 json 作为值的注册变量,需要从这个 JSON 中提取名称和 dn 以列出。使用 set_fact 尝试了不同的选项,但没有任何运气。
{
"nodes": {
"status": -1,
"imdata": [
{
"fabricNode": {
"attributes": {
"status": "",
"dn": "topology/pod-1/node-1",
"name": "NOQCJALAB1"
}
}
},
{
"fabricNode": {
"attributes": {
"status": "",
"dn": "topology/pod-1/node-1",
"name": "NOQCJALAB2"
}
}
}
],
"totalCount": 2,
"changed": false,
"failed": false
},
"changed": false,
"_ansible_verbose_always": true,
"_ansible_no_log": false
}
【问题讨论】: