1
---
- name: "Gateway Checker"
hosts: vms_windows
gather_facts: True
tasks:
- debug: var=ansible_interfaces
使用獲取我:找回Windows主機的默認網關使用PowerShell腳本
TASK [debug] *******************************************************************
ok: [dc00.domain.test] => {
"ansible_interfaces": [
{
"default_gateway": "192.168.10.254",
"dns_domain": null,
"interface_index": 12,
"interface_name": "Intel(R) PRO/1000 MT Network Connection"
}
]
}
但去爲:
- debug: var=ansible_interfaces.default_gateway
獲取我:
"ansible_interfaces.default_gateway": "VARIABLE IS NOT DEFINED!"
任何想法上我可能在這裏做錯了什麼?