From 3e4b83d964a4b79005482b23960476585b6b04d8 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Sat, 28 May 2016 01:41:07 +0200 Subject: [PATCH 1/4] Added DNS Configs --- files/fftdf/db.188.10 | 22 +++++++++++++++++++ ...b.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa | 20 +++++++++++++++++ files/fftdf/db.fftdf | 22 +++++++++++++++++++ files/fftdf/fftdf.conf | 21 ++++++++++++++++++ files/named.conf.local | 10 +++++++++ 5 files changed, 95 insertions(+) create mode 100644 files/fftdf/db.188.10 create mode 100644 files/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa create mode 100644 files/fftdf/db.fftdf create mode 100644 files/fftdf/fftdf.conf create mode 100644 files/named.conf.local diff --git a/files/fftdf/db.188.10 b/files/fftdf/db.188.10 new file mode 100644 index 0000000..2d6dad7 --- /dev/null +++ b/files/fftdf/db.188.10 @@ -0,0 +1,22 @@ +;; db.188.10 +;; Reverse lookup zone for fftdf +;; +$TTL 2D +@ IN SOA fftdf. root.fftdf. ( + 2014071300 ; Serial + 8H ; Refresh + 2H ; Retry + 4W ; Expire + 2D ) ; TTL Negative Cache + +@ IN NS dns1.infra.fftdf. + +1.0 IN PTR nextnode.fftdf. +;; Update Servers +22.1 IN PTR update1.infra.fftdf. +23.1 IN PTR update2.infra.fftdf. +24.1 IN PTR update3.infra.fftdf. +25.1 IN PTR update4.infra.fftdf. +;; Map Server +21.1 IN PTR map.infa.fftdf. +1.1 IN PTR gateway1.infra.fftdf. \ No newline at end of file diff --git a/files/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa b/files/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa new file mode 100644 index 0000000..49903e0 --- /dev/null +++ b/files/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa @@ -0,0 +1,20 @@ +;; db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa +;; IPv6 reverse lookup zone for fftdf +;; +$TTL 2D +$ORIGIN 5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa. +@ IN SOA fftdf. root.fftdf. ( + 2014071301 ; Serial + 8H ; Refresh + 2H ; Retry + 4W ; Expire + 2D ) ; TTL Negative Cache +@ NS dns1.infra.fftdf. + +1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR nextnode.fftdf. +2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR update1.infra.fftdf. +3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR update1.infra.fftdf. +4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR update1.infra.fftdf. +5.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR update1.infra.fftdf. +1.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR map.infra.fftdf. +1.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR gateway1.infra.fftdf. \ No newline at end of file diff --git a/files/fftdf/db.fftdf b/files/fftdf/db.fftdf new file mode 100644 index 0000000..56b405d --- /dev/null +++ b/files/fftdf/db.fftdf @@ -0,0 +1,22 @@ +;; db.fftdf +;; Forwardlookupzone für .fftdf +;; +$TTL 600 +@ IN SOA fftdf. root.fftdf. ( + 2015584543 ; Serial + 8H ; Refresh + 2H ; Retry + 4W ; Expire + 3H ) ; NX (TTL Negativ Cache) + +@ IN NS {{ sn_hostname }}.infra.fftdf. + IN A {{ sn_mesh_ipv4 }} + IN AAAA {{ sn_mesh_ipv6 }} +localhost IN A 127.0.0.1 + IN AAAA ::1 +nextnode IN A 10.188.0.1 + IN AAAA 2a03:2260:121::1 +;; Update Servers +update1.infra IN AAAA 2a03:2260:121::22 +update2.infra IN AAAA 2a03:2260:121::23 +update3.infra IN AAAA 2a03:2260:121::24 diff --git a/files/fftdf/fftdf.conf b/files/fftdf/fftdf.conf new file mode 100644 index 0000000..7d40d95 --- /dev/null +++ b/files/fftdf/fftdf.conf @@ -0,0 +1,21 @@ +// Zone declarations for Freifunk Troisdorf + +zone "fftdf" { + type master; + file "/etc/bind/fftdf/db.fftdf"; +}; + +zone "nodes.fftdf" { + type master; + file "/etc/bind/fftdf/db.nodes.fftdf"; +}; + +zone "188.10.in-addr.arpa" { + type master; + file "/etc/bind/fftdf/db.188.10"; +}; + +zone "5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa" { + type master; + file "/etc/bind/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa"; +}; \ No newline at end of file diff --git a/files/named.conf.local b/files/named.conf.local new file mode 100644 index 0000000..db75b20 --- /dev/null +++ b/files/named.conf.local @@ -0,0 +1,10 @@ +// +// Do any local configuration here +// + +// Consider adding the 1918 zones here, if they are not used in your +// organization +//include "/etc/bind/zones.rfc1918"; + +// Include Freifunk Troisdorf (fftdf) zones +include "/etc/bind/fftdf/fftdf.conf"; \ No newline at end of file From 2ce8651c26cd3df2ceaee0617a03434a00da688f Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Sat, 28 May 2016 12:26:12 +0200 Subject: [PATCH 2/4] DNS Integration --- files/fftdf/fftdf.conf | 15 --------------- install.sn.yml | 39 ++++++++++++++++++--------------------- 2 files changed, 18 insertions(+), 36 deletions(-) diff --git a/files/fftdf/fftdf.conf b/files/fftdf/fftdf.conf index 7d40d95..e94dfa6 100644 --- a/files/fftdf/fftdf.conf +++ b/files/fftdf/fftdf.conf @@ -3,19 +3,4 @@ zone "fftdf" { type master; file "/etc/bind/fftdf/db.fftdf"; -}; - -zone "nodes.fftdf" { - type master; - file "/etc/bind/fftdf/db.nodes.fftdf"; -}; - -zone "188.10.in-addr.arpa" { - type master; - file "/etc/bind/fftdf/db.188.10"; -}; - -zone "5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa" { - type master; - file "/etc/bind/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa"; }; \ No newline at end of file diff --git a/install.sn.yml b/install.sn.yml index ad104a1..5a8e20d 100644 --- a/install.sn.yml +++ b/install.sn.yml @@ -3,13 +3,12 @@ # ansible troisdorf4 -u root -m raw -a "apt-get update && apt-get install python -y" - name: Install Freifunk Troisdorf super node -# hosts: FreifunkSupernodesL2TP hosts: '{{ target }}' sudo: False user: root gather_facts: False vars: - snversion: master_v3.0.15 + snversion: master_v3.0.14 batmanversion: v2015.2 common_required_packages: - git @@ -57,10 +56,10 @@ - tunneldigger.service - tunneldigger-backup.service broker_cfg: - - l2tp_broker-backup.cfg - - l2tp_broker.cfg -# bind_zone_fftdf: -# - named.conf.fftdf + - l2tp_broker.cfg-backup.j2 + - l2tp_broker.cfg.j2 + bind_zone_fftdf: + - named.conf.fftdf check_gw_script: - keepalive.sh authorized_keys: @@ -76,8 +75,6 @@ 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: Update apt cache apt: update_cache=yes - name: Gathering facts @@ -130,17 +127,14 @@ shell: > apt-get install linux-headers-$(uname -r) -y when: aptupdates.changed +# Install Batman-adv and batctl # - name: Get batman-adv git: repo=https://git.open-mesh.org/batman-adv.git dest=/tmp/batman-adv when: aptupdates.changed register: getbatman -# - name: Get batman-adv no rebrotcast patch -# get_url: url=http://map.freifunk-moehne.de/stuff/1001-batman-adv-introduce-no_rebroadcast-option.patch dest=/tmp/batman-adv/1001-batman-adv-introduce-no_rebroadcast-option.patch -# when: getbatman.changed - name: Install batman-adv shell: cd /tmp/batman-adv && git checkout {{ batmanversion }} && make && make install -# shell: cd /tmp/batman-adv && git checkout {{ batmanversion }} && git apply 1001-batman-adv-introduce-no_rebroadcast-option.patch && make && make install when: getbatman.changed - name: Get batctl git: repo=http://git.open-mesh.org/batctl.git @@ -150,8 +144,8 @@ - name: Install batctl shell: cd /tmp/batctl && git checkout {{ batmanversion }} && make && make install when: getbatctl.changed +# Install Tunneldigger # - name: Get Tunneldigger -# git: repo=https://github.com/wlanslovenija/tunneldigger.git git: repo=https://github.com/ffrl/tunneldigger.git dest=/srv/tunneldigger register: tunneldigger @@ -165,7 +159,7 @@ pip: requirements=/srv/tunneldigger/broker/requirements.txt virtualenv=/srv/tunneldigger/ when: tunneldigger.changed - name: Copy l2tp broker config template - template: src=./files/{{ item }} dest=/srv/tunneldigger owner=root group=root mode=0444 + template: src=./files/{{ item }} dest=/srv/ owner=root group=root mode=0444 with_items: broker_cfg when: tunneldigger.changed - name: Copy tunneldigger script template @@ -175,8 +169,8 @@ copy: src=./files/{{ item }} dest=/srv/tunneldigger owner=root group=root mode=0500 with_items: tunneldigger_scripts when: tunneldigger.changed - - name: Copy tunneldigger service template - copy: src=./files/{{ item }} dest=/etc/systemd/system owner=root group=root mode=0444 + - name: Copy tunneldigger service file + copy: src=./files/{{ item }} dest=/etc/systemd/system/ owner=root group=root mode=0444 with_items: tunneldigger_service when: tunneldigger.changed - name: Tunneldigger reload @@ -184,7 +178,6 @@ with_items: - systemctl daemon-reload - systemctl enable tunneldigger.service - - systemctl enable tunneldigger-backup.service when: tunneldigger.changed - name: Copy logrotate config copy: src=./files/{{ item }} dest=/etc/ owner=root group=root mode=0500 @@ -253,13 +246,17 @@ - name: SSH authorized_keys copy: src=./files/{{ item }} dest=/root/.ssh owner=root group=root mode=0400 with_items: authorized_keys -# - name: Copy secondary zone file -# copy: src=./files/{{ item }} dest=/etc/bind owner=root group=bind mode=644 -# with_items: bind_zone_fftdf - name: Bind9, activate fftdf zone - lineinfile: dest=/etc/bind/named.conf line='include "/etc/bind/named.conf.fftdf";' state=present + lineinfile: dest=/etc/bind/named.conf line='include "/etc/bind/fftdf/fftdf.conf";' state=present - name: Copy option template template: src=./files/named.conf.options.j2 dest=/etc/bind/named.conf.options owner=root group=bind mode=644 + - name: Create fftdf directory + file: path=/etc/bind/fftdf state=directory + - name: Copy FFTDF Zones + copy: src=./files/fftdf/{{ item }} dest=/etc/bind/fftdf/{{ item }} owner=root group=bind mode=644 + with_items: + - fftdf.conf + - db.fftdf - name: Copy radvd config template template: src=./files/radvd.conf.j2 dest=/etc/radvd.conf owner=radvd group=root mode=0444 - name: Interface configuration with ffrl gre tunnel From 57e6976ca9aa106714b521b6c7be55d40130471d Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Sat, 28 May 2016 12:27:49 +0200 Subject: [PATCH 3/4] Removed Old DNS Files --- files/fftdf/db.188.10 | 22 ------------------- ...b.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa | 20 ----------------- 2 files changed, 42 deletions(-) delete mode 100644 files/fftdf/db.188.10 delete mode 100644 files/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa diff --git a/files/fftdf/db.188.10 b/files/fftdf/db.188.10 deleted file mode 100644 index 2d6dad7..0000000 --- a/files/fftdf/db.188.10 +++ /dev/null @@ -1,22 +0,0 @@ -;; db.188.10 -;; Reverse lookup zone for fftdf -;; -$TTL 2D -@ IN SOA fftdf. root.fftdf. ( - 2014071300 ; Serial - 8H ; Refresh - 2H ; Retry - 4W ; Expire - 2D ) ; TTL Negative Cache - -@ IN NS dns1.infra.fftdf. - -1.0 IN PTR nextnode.fftdf. -;; Update Servers -22.1 IN PTR update1.infra.fftdf. -23.1 IN PTR update2.infra.fftdf. -24.1 IN PTR update3.infra.fftdf. -25.1 IN PTR update4.infra.fftdf. -;; Map Server -21.1 IN PTR map.infa.fftdf. -1.1 IN PTR gateway1.infra.fftdf. \ No newline at end of file diff --git a/files/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa b/files/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa deleted file mode 100644 index 49903e0..0000000 --- a/files/fftdf/db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa +++ /dev/null @@ -1,20 +0,0 @@ -;; db.5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa -;; IPv6 reverse lookup zone for fftdf -;; -$TTL 2D -$ORIGIN 5.0.4.7.9.2.b.a.e.7.4.7.0.a.d.f.ip6.arpa. -@ IN SOA fftdf. root.fftdf. ( - 2014071301 ; Serial - 8H ; Refresh - 2H ; Retry - 4W ; Expire - 2D ) ; TTL Negative Cache -@ NS dns1.infra.fftdf. - -1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR nextnode.fftdf. -2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR update1.infra.fftdf. -3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR update1.infra.fftdf. -4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR update1.infra.fftdf. -5.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR update1.infra.fftdf. -1.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR map.infra.fftdf. -1.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR gateway1.infra.fftdf. \ No newline at end of file From c23881fbe7f067fa572fec5d77da98d89b413602 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Sat, 28 May 2016 15:47:29 +0200 Subject: [PATCH 4/4] Bugfix --- install.sn.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/install.sn.yml b/install.sn.yml index 5a8e20d..67360d1 100644 --- a/install.sn.yml +++ b/install.sn.yml @@ -3,12 +3,13 @@ # ansible troisdorf4 -u root -m raw -a "apt-get update && apt-get install python -y" - name: Install Freifunk Troisdorf super node +# hosts: FreifunkSupernodesL2TP hosts: '{{ target }}' sudo: False user: root gather_facts: False vars: - snversion: master_v3.0.14 + snversion: master_v3.0.15 batmanversion: v2015.2 common_required_packages: - git @@ -56,10 +57,10 @@ - tunneldigger.service - tunneldigger-backup.service broker_cfg: - - l2tp_broker.cfg-backup.j2 - - l2tp_broker.cfg.j2 - bind_zone_fftdf: - - named.conf.fftdf + - l2tp_broker-backup.cfg + - l2tp_broker.cfg +# bind_zone_fftdf: +# - named.conf.fftdf check_gw_script: - keepalive.sh authorized_keys: @@ -75,6 +76,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: Update apt cache apt: update_cache=yes - name: Gathering facts @@ -127,14 +130,17 @@ shell: > apt-get install linux-headers-$(uname -r) -y when: aptupdates.changed -# Install Batman-adv and batctl # - name: Get batman-adv git: repo=https://git.open-mesh.org/batman-adv.git dest=/tmp/batman-adv when: aptupdates.changed register: getbatman +# - name: Get batman-adv no rebrotcast patch +# get_url: url=http://map.freifunk-moehne.de/stuff/1001-batman-adv-introduce-no_rebroadcast-option.patch dest=/tmp/batman-adv/1001-batman-adv-introduce-no_rebroadcast-option.patch +# when: getbatman.changed - name: Install batman-adv shell: cd /tmp/batman-adv && git checkout {{ batmanversion }} && make && make install +# shell: cd /tmp/batman-adv && git checkout {{ batmanversion }} && git apply 1001-batman-adv-introduce-no_rebroadcast-option.patch && make && make install when: getbatman.changed - name: Get batctl git: repo=http://git.open-mesh.org/batctl.git @@ -144,8 +150,8 @@ - name: Install batctl shell: cd /tmp/batctl && git checkout {{ batmanversion }} && make && make install when: getbatctl.changed -# Install Tunneldigger # - name: Get Tunneldigger +# git: repo=https://github.com/wlanslovenija/tunneldigger.git git: repo=https://github.com/ffrl/tunneldigger.git dest=/srv/tunneldigger register: tunneldigger @@ -159,7 +165,7 @@ pip: requirements=/srv/tunneldigger/broker/requirements.txt virtualenv=/srv/tunneldigger/ when: tunneldigger.changed - name: Copy l2tp broker config template - template: src=./files/{{ item }} dest=/srv/ owner=root group=root mode=0444 + template: src=./files/{{ item }} dest=/srv/tunneldigger owner=root group=root mode=0444 with_items: broker_cfg when: tunneldigger.changed - name: Copy tunneldigger script template @@ -169,8 +175,8 @@ copy: src=./files/{{ item }} dest=/srv/tunneldigger owner=root group=root mode=0500 with_items: tunneldigger_scripts when: tunneldigger.changed - - name: Copy tunneldigger service file - copy: src=./files/{{ item }} dest=/etc/systemd/system/ owner=root group=root mode=0444 + - name: Copy tunneldigger service template + copy: src=./files/{{ item }} dest=/etc/systemd/system owner=root group=root mode=0444 with_items: tunneldigger_service when: tunneldigger.changed - name: Tunneldigger reload @@ -178,6 +184,7 @@ with_items: - systemctl daemon-reload - systemctl enable tunneldigger.service + - systemctl enable tunneldigger-backup.service when: tunneldigger.changed - name: Copy logrotate config copy: src=./files/{{ item }} dest=/etc/ owner=root group=root mode=0500 @@ -313,4 +320,4 @@ msg: "{{ inventory_hostname }} completed with {{ snversion }}" channel: "#technik" username: "Ansible on {{ inventory_hostname }}" - parse: 'none' + parse: 'none' \ No newline at end of file