0
我想在Ansible的這個輸出中定位路徑變量。Ansible - 如何定位項目
ok: [myMachine1] => {
"foundFiles": {
...
"results": [
{
...
"files": [
{
...
"path": "/my/first/path",
...
}
],
},
{
...
"files": [
{
...
"path": "/my/second/path",
...
}
}
]
}
}
我該如何告訴Ansible目標'路徑'變量。 我想有:
- debug:
msg: "{{ item.files.path }}"
with_items:
- foundFiles.results
但只得到"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'unicode object' has no attribute 'key'
感謝大師的。