13 lines
477 B
Text
13 lines
477 B
Text
|
{% set ip4hex = item.value.ipv4_network | ipaddr('net') | ipaddr(magic) | ipaddr('address') | ip4_hex() -%}
|
||
|
{% set mac = '0200' + ip4hex -%}
|
||
|
#
|
||
|
# {{ ansible_managed }}
|
||
|
#
|
||
|
auto {{ item.key }}0
|
||
|
iface {{ item.key }}0 inet manual
|
||
|
pre-up /sbin/ip link add $IFACE type dummy
|
||
|
pre-up /sbin/ip link set address {{ mac | hwaddr('linux') }} dev $IFACE
|
||
|
pre-up /sbin/ip link set up dev $IFACE
|
||
|
post-up /sbin/ip addr flush dev $IFACE
|
||
|
post-down /sbin/ip link delete $IFACE 2>&1 || true
|