【发布时间】:2015-08-08 15:33:38
【问题描述】:
我在 Ansible 中注册了名为“network”的变量:
{
"addresses": {
"private_ext": [
{
"type": "fixed",
"addr": "172.16.2.100"
}
],
"private_man": [
{
"type": "fixed",
"addr": "172.16.1.100"
},
{
"type": "floating",
"addr": "10.90.80.10"
}
]
}
}
是否有可能通过 type="floating" 获取 IP 地址(“addr”)?
- debug: var={{ network.addresses.private_man | filter type="fixed" | get "addr" }}
我知道语法是错误的,但你明白了。
【问题讨论】: