Add common roles from polyfloyd's playbookds
This commit is contained in:
parent
1332f49101
commit
e43ec3229f
23 changed files with 694 additions and 0 deletions
38
roles/common/templates/network-interfaces
Normal file
38
roles/common/templates/network-interfaces
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Managed by Ansible
|
||||
|
||||
# This file describes the network interfaces available on your system
|
||||
# and how to activate them. For more information, see interfaces(5).
|
||||
|
||||
source /etc/network/interfaces.d/*
|
||||
|
||||
# The loopback network interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
# The primary network interface
|
||||
auto eth0
|
||||
allow-hotplug eth0
|
||||
|
||||
{% if network_br %}
|
||||
iface eth0 inet manual
|
||||
|
||||
auto br0
|
||||
iface br0 inet static
|
||||
address {{ network_static.address_v4 }}
|
||||
gateway {{ network_static.gateway_v4 }}
|
||||
bridge_ports eth0
|
||||
|
||||
iface br0 inet6 auto
|
||||
up echo -n 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping
|
||||
up ip -6 addr add {{ network_static.address_v6 }} dev br0
|
||||
up ip -6 route add default via {{ network_static.gateway_v6 }} dev br0
|
||||
bridge_stp on
|
||||
|
||||
{% elif network_static %}
|
||||
iface eth0 inet static
|
||||
address {{ network_static.address_v4 }}
|
||||
gateway {{ network_static.gateway_v4 }}
|
||||
|
||||
{% else %}
|
||||
iface eth0 inet dhcp
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue