From 65454f7ed48e06c26bbc73f4bc1c8ed130646686 Mon Sep 17 00:00:00 2001 From: Ansible Admin Date: Thu, 17 Dec 2015 11:21:59 +0100 Subject: [PATCH] Kernel 3.x and Alfred is back --- files/alfred.sh.j2 | 51 ++++++++++++++++++++++++++++++++++++++++ files/bataddif.sh.j2 | 6 +++-- files/gre_backbone.sh.j2 | 6 ++--- install.sn.yml | 22 ++++++++++------- 4 files changed, 72 insertions(+), 13 deletions(-) create mode 100644 files/alfred.sh.j2 diff --git a/files/alfred.sh.j2 b/files/alfred.sh.j2 new file mode 100644 index 0000000..bc03367 --- /dev/null +++ b/files/alfred.sh.j2 @@ -0,0 +1,51 @@ +#!/bin/sh + +release=$(/bin/uname -r) +nodeid=$( /bin/echo {{ sn_mesh_MAC }} | /bin/sed s/://g) +#meshh_if=$(/bin/cat /sys/class/net/troisdorf*/address | /bin/grep -v ^00:00:00) +meshh_if=$(/bin/cat /sys/class/net/l2tp*/address | /bin/grep -v ^00:00:00) +tempfile=/tmp/alfred_info + +if [ -f $tempfile ] + then + /bin/rm $tempfile +fi + +/bin/cat > $tempfile < /sys/devices/virtual/net/$INTERFACE/batman_adv/no_rebroadcast diff --git a/files/gre_backbone.sh.j2 b/files/gre_backbone.sh.j2 index 41fb365..8c1e16f 100644 --- a/files/gre_backbone.sh.j2 +++ b/files/gre_backbone.sh.j2 @@ -3,7 +3,7 @@ communityname="troisdorf" server="troisdorf0 {{ sn_hostname }}" domain="freifunk-troisdorf.de" -mtu=1400 +mtu=1500 # community MAC address, without the last Byte (:)! communitymacaddress="a2:8c:ae:6f:f6" # Network part of the network, without the trailing dot @@ -26,8 +26,8 @@ for i in $server; do if [ $i != $j ]; then if [ $i = $(/bin/hostname) ]; then -# /sbin/ip link add $j type gretap local $(/bin/hostname -I | /usr/bin/cut -f1 -d' ') remote $(/usr/bin/dig +short $j.$domain) dev eth0 nopmtudisc - /sbin/ip link add $j type gretap local $(/bin/hostname -I | /usr/bin/cut -f1 -d' ') remote $(/usr/bin/dig +short $j.$domain) dev eth0 + /sbin/ip link add $j type gretap local $(/bin/hostname -I | /usr/bin/cut -f1 -d' ') remote $(/usr/bin/dig +short $j.$domain) dev eth0 nopmtudisc +# /sbin/ip link add $j type gretap local $(/bin/hostname -I | /usr/bin/cut -f1 -d' ') remote $(/usr/bin/dig +short $j.$domain) dev eth0 /sbin/ip link set dev $j mtu $mtu # /sbin/ip link set address $communitymacaddress:${i#$communityname}${j#$communityname} dev $j # /sbin/ip link set address $communitymacaddress$:0${localserver#$communityname} dev $j diff --git a/install.sn.yml b/install.sn.yml index 8a3f4a8..bdefdb5 100644 --- a/install.sn.yml +++ b/install.sn.yml @@ -218,6 +218,12 @@ template: src=./files/named.conf.options.j2 dest=/etc/bind/named.conf.options owner=root group=bind mode=644 - name: Copy radvd config template template: src=./files/radvd.conf.j2 dest=/etc/radvd.conf owner=radvd group=root mode=0444 + + - name: Alfed message + template: src=./files/alfred.sh.j2 dest=/opt/freifunk/alfred.sh owner=root group=root mode=0544 + - name: Add cron job with alfred info script + cron: name=alfred_info job="/opt/freifunk/alfred.sh > /dev/null 2>&1" user="root" + - name: Reboot the server finally shell: sleep 2 && shutdown -r now "Ansible updates triggered" async: 1 @@ -232,11 +238,11 @@ delay=15 timeout=300 when: tunneldigger.changed - - name: Send notification message via Slack - local_action: - module: slack - token: "{{ slack_token }}" - msg: "{{ inventory_hostname }} completed with branch testing" - channel: "#technik" - username: "Ansible on {{ inventory_hostname }}" - parse: 'none' +# - name: Send notification message via Slack +# local_action: +# module: slack +# token: "{{ slack_token }}" +# msg: "{{ inventory_hostname }} completed with branch testing" +# channel: "#technik" +# username: "Ansible on {{ inventory_hostname }}" +# parse: 'none'