From ea411cb3414f4494a4acf2a189aa2fb98f04917d Mon Sep 17 00:00:00 2001 From: Ansible Admin Date: Tue, 26 Jan 2016 22:58:39 +0100 Subject: [PATCH] Change to super node and exit node in one server --- .install.sn.yml.swp | Bin 0 -> 24576 bytes files/keepalive.sh | 4 ++-- files/l2tp_backbone.sh.exit.j2 | 7 ++++--- files/sn_startup.exit.sh.j2 | 18 ++++++++++++++++++ install.sn.yml | 10 +++++----- 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 .install.sn.yml.swp diff --git a/.install.sn.yml.swp b/.install.sn.yml.swp new file mode 100644 index 0000000000000000000000000000000000000000..d56777a9c9a16952d8b2b53aff282661b41b7f35 GIT binary patch literal 24576 zcmeHPd#oKtd0$c<4FpUGkCIk&xR>T8z@Bq`eeJ{tPMX-U6T5aXzBWY=a zw5%XpufQR1o`wSr2O17E9B4SuaG>Ep!-0ka4F`T} zIFQB9x88@@UZ!T8sNd(+eqW&ee!KcjYxU1pe;-!AU#r#sj{191{k}{MpvO_g%}>LD zh64=;8V)oZXgJVtpy5EnfrbMO2O17E9B4T38{mNBS=QC)_rJ*yNBm#g|3BP;TmYa4 z+yN{DJAhxm%(DI!cpUgg;8EZ{;4IJs)_{XR2Uq}h0MESCvi=45KJa(IXMuZx4*(oE z4s?Mx1Fr!7;|jC~ehhpK_#*HCa363ta1MxoJAmWBTY>9jsU>RIrk{;^e#XaXhq=*s9EH7v-;f$Kv&2_skhaJ+QN9MW>pILoyvibqgY7x6J6)CXzZ#64i4Zcf`9} z#gLmL9%4+MjiNN8xwYJp6ArnjsTcKBnbvCL?9_iVf6Svi>+V`!RxcXW9uJ(Y?#k4< zI7+ha%F49YXjn1#aD#_glx+1hm6{XAD2#17e%2dAiRw(G(DWQP^P{jM$~5Pwp&t$z z+G6s_22WTP5g$40V@=q#JJaks)ysughYL7M&Ekm{Eo5uiWHCpQ&Wfs+SWn_ANe;iu#7(jB)RKe?~B|L8484*ltY9{zLkoxNKQ9K8ADkrUk|Mjd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usr/local/sbin/batctl gw server 100Mbit/100Mbit diff --git a/files/sn_startup.exit.sh.j2 b/files/sn_startup.exit.sh.j2 index b8c11fd..7e40342 100644 --- a/files/sn_startup.exit.sh.j2 +++ b/files/sn_startup.exit.sh.j2 @@ -45,6 +45,12 @@ done # Allow MAC address spoofing /sbin/sysctl net.ipv4.conf.bat0.rp_filter=0 +# Create Tunneldigger Bridge +/sbin/brctl addbr br-nodes +/sbin/ip link set dev br-nodes up +/sbin/ebtables -A FORWARD --logical-in br-nodes -j DROP +/usr/local/sbin/batctl if add br-nodes + sleep 5 # stop tunneldigger @@ -65,4 +71,16 @@ sleep 5 /bin/systemctl disable isc-dhcp-server /bin/systemctl stop isc-dhcp-server +# Start tunneldigger +/bin/systemctl restart tunneldigger +/bin/systemctl enable tunneldigger + +# radvd restart +/bin/systemctl restart radvd +/bin/systemctl enable radvd + +# restart DHCP +/bin/systemctl restart isc-dhcp-server +/bin/systemctl enable isc-dhcp-server + exit 0 diff --git a/install.sn.yml b/install.sn.yml index 1a8d4d0..c846a79 100644 --- a/install.sn.yml +++ b/install.sn.yml @@ -9,7 +9,7 @@ user: root gather_facts: False vars: - snversion: master_v2.1 + snversion: master_v2.9000001_beta batmanversion: v2015.2 common_required_packages: - git @@ -71,8 +71,8 @@ raw: "sed -i '/deb cdrom/c\\#' /etc/apt/sources.list" - name: Make this server ansible compatible raw: "apt-get update && apt-get install python -y" - - name: Add backport repo to source list #target: /etc/apt/sources.list.d - apt_repository: repo='deb http://http.debian.net/debian jessie-backports main' state=present +# - name: Add backport repo to source list #target: /etc/apt/sources.list.d +# apt_repository: repo='deb http://http.debian.net/debian jessie-backports main' state=present - name: Update apt cache apt: update_cache=yes - name: Gathering facts @@ -196,7 +196,7 @@ copy: src=./files/{{ item }} dest=/opt/freifunk owner=root group=root mode=0500 with_items: check_gw_script register: check_gw - when: sn_exit is undefined +# when: sn_exit is undefined - name: Add cron job with check gateway script cron: name=check_gw job="/opt/freifunk/keepalive.sh > /dev/null 2>&1" user="root" when: check_gw.changed @@ -205,7 +205,7 @@ copy: src=./files/{{ item }} dest=/opt/freifunk owner=root group=root mode=0500 with_items: tunneld_stats_file register: tunneld_stats - when: sn_exit is undefined +# when: sn_exit is undefined - name: Add cron job tunneldigger stats cron: name=tunneld_stats job="/opt/freifunk/collectd_td_stat.sh > /dev/null 2>&1" user="root" when: tunneld_stats.changed