【发布时间】:2021-04-29 09:09:13
【问题描述】:
我试图通过参考以下文档来配置 Azure 应用程序网关。 https://docs.microsoft.com/en-us/azure/developer/ansible/application-gateway-configure?tabs=ansible 但我没有使用容器,而是使用虚拟机作为后端池。
- name: Get info of backend server 1
azure_rm_resource_info:
api_version: '2018-04-01'
resource_group: "{{ resource_group }}"
provider: compute
resource_type: virtualmachines
resource_name: "{{ vm_1_name }}"
register: vm_1_output
- name: Create instance of Application Gateway
azure_rm_appgateway:
resource_group: "{{ resource_group }}"
name: "{{ appgw_name }}"
frontend_ip_configurations:
- public_ip_address: "publicip-{{env}}-{{appgw_name}}"
name: appGatewayFrontendIP
frontend_ports:
- port: 80
name: appGatewayFrontendPort
backend_address_pools:
- backend_addresses:
- ip_address: "{{ vm_1_output.response[0].properties.ipAddress.ip }}"
name: appGatewayBackendPool
但我收到以下错误。
"The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'ipAddress'\n\nThe error appears to be in
我已尝试更改值 IpAddress.ip、IPAddress.ip 和 private_ip_address.id 但仍然失败。任何帮助将不胜感激。
谢谢
【问题讨论】:
-
可以发
vm_1_output的样本数据结构吗?或者,如果您已经完成了debug的操作,可以深入了解response[0].properties的内容?是否有密钥ipAddress? -
这个运气好吗?您有机会检查提供的解决方案吗?