diff --git a/roles/mesh-interfaces/handlers/main.yml b/roles/mesh-interfaces/handlers/main.yml new file mode 100644 index 0000000..bd10989 --- /dev/null +++ b/roles/mesh-interfaces/handlers/main.yml @@ -0,0 +1,4 @@ +--- + +- name: Reload interfaces + command: /sbin/ifreload -a diff --git a/roles/mesh-interfaces/tasks/main.yml b/roles/mesh-interfaces/tasks/main.yml new file mode 100644 index 0000000..3447a42 --- /dev/null +++ b/roles/mesh-interfaces/tasks/main.yml @@ -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 diff --git a/roles/mesh-interfaces/templates/mesh.conf.j2 b/roles/mesh-interfaces/templates/mesh.conf.j2 new file mode 100644 index 0000000..e6fa841 --- /dev/null +++ b/roles/mesh-interfaces/templates/mesh.conf.j2 @@ -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 diff --git a/site.yml b/site.yml index 33da1cf..0318da6 100644 --- a/site.yml +++ b/site.yml @@ -12,6 +12,7 @@ roles: - batman - fastd + - mesh-interfaces - dns - name: Setup confluence server