94cb21daad
- Update Readme - Update ansible.cfg - Add playbook to set up gateways - Add group variables
12 lines
477 B
Django/Jinja
12 lines
477 B
Django/Jinja
{% 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
|