ipaddr was moved to ansible.utils
This commit is contained in:
parent
8276c6e8b4
commit
32ddf5e58e
9 changed files with 16 additions and 16 deletions
|
|
@ -33,14 +33,14 @@ iface {{ iface.name }}
|
|||
{% for address in iface.ip_addresses %}
|
||||
address {{ address.address }}
|
||||
{% if address.family.value == 4 %}
|
||||
{% set subnet = address.address | ipaddr('subnet') %}
|
||||
{% set subnet = address.address | ansible.utils.ipaddr('subnet') %}
|
||||
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
|
||||
{% set gateway = prefix.custom_fields.gateway.address %}
|
||||
{% if gateway is defined and gateway != address.address %}
|
||||
{% if iface.vrf %}
|
||||
up ip route add default via {{ gateway | ipaddr('address') }} {% if iface.vrf.name %}vrf {{ iface.vrf.name }}{% endif +%}
|
||||
up ip route add default via {{ gateway | ansible.utils.ipaddr('address') }} {% if iface.vrf.name %}vrf {{ iface.vrf.name }}{% endif +%}
|
||||
{% else %}
|
||||
gateway {{ gateway | ipaddr('address') }}
|
||||
gateway {{ gateway | ansible.utils.ipaddr('address') }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue