ansible-alpine-host/templates/etc/network/interfaces.j2

19 lines
477 B
Plaintext
Raw Normal View History

2022-04-10 00:29:22 +00:00
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address {{ hostvars[inventory_hostname].ansible_default_ipv4.address }}
netmask {{ hostvars[inventory_hostname].ansible_default_ipv4.netmask }}
gateway {{ hostvars[inventory_hostname].ansible_default_ipv4.gateway }}
{% if ip6 is defined %}
iface eth0 inet6 static
address {{ ip6 }}
netmask {{ netmask6 }}
gateway {{ gateway6 }}
pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra
{% endif %}