Add interface config (using ifupdown2)
This commit is contained in:
parent
2defb06c57
commit
40e6102c8c
4
roles/mesh-interfaces/handlers/main.yml
Normal file
4
roles/mesh-interfaces/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Reload interfaces
|
||||||
|
command: /sbin/ifreload -a
|
17
roles/mesh-interfaces/tasks/main.yml
Normal file
17
roles/mesh-interfaces/tasks/main.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Enable backports
|
||||||
|
apt_repository: repo='deb http://httpredir.debian.org/debian jessie-backports main' state=present
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
apt: name=python-pkg-resources
|
||||||
|
|
||||||
|
- name: Install ifupdown2
|
||||||
|
apt: name=ifupdown2 default_release=jessie-backports state=latest
|
||||||
|
|
||||||
|
- name: Uninstall ifupdown
|
||||||
|
apt: name=ifupdown state=absent
|
||||||
|
|
||||||
|
- name: Configure mesh interfaces
|
||||||
|
template: src=mesh.conf.j2 dest=/etc/network/interfaces.d/mesh.conf
|
||||||
|
notify: Reload interfaces
|
28
roles/mesh-interfaces/templates/mesh.conf.j2
Normal file
28
roles/mesh-interfaces/templates/mesh.conf.j2
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
|
# br-{{ site_code }}
|
||||||
|
auto br-{{ site_code }}
|
||||||
|
iface br-{{ site_code }}
|
||||||
|
bridge-fd 0
|
||||||
|
bridge-ports bat-{{ site_code }}
|
||||||
|
bridge-stp no
|
||||||
|
#
|
||||||
|
address {{ batman_ipv4 }}
|
||||||
|
address {{ batman_ipv6 }}
|
||||||
|
mtu 1500
|
||||||
|
|
||||||
|
# bat-{{ site_code }}
|
||||||
|
auto bat-{{ site_code }}
|
||||||
|
iface bat-{{ site_code }}
|
||||||
|
batman-hop-penalty 5
|
||||||
|
batman-ifaces dmy-{{ site_code }} vpn-{{ site_code }}
|
||||||
|
batman-ifaces-ignore-regex .*_.*
|
||||||
|
#
|
||||||
|
mtu 1500
|
||||||
|
|
||||||
|
# dmy-{{ site_code }}
|
||||||
|
auto dmy-{{ site_code }}
|
||||||
|
iface dmy-{{ site_code }}
|
||||||
|
hwaddress f2:00:90:00:{{ gateway_id }}:00
|
||||||
|
link-type dummy
|
||||||
|
mtu 1560
|
Loading…
Reference in New Issue
Block a user