Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungNächste ÜberarbeitungBeide Seiten der Revision | ||
centos:ansible:ffmuc-rpb4-ol [09.03.2020 18:31. ] – [Starten des Ansible-Playbooks raspi_offloader.yml] django | centos:ansible:ffmuc-rpb4-ol [07.04.2022 18:57. ] – [Kopieren des Raspbian Images auf die microSD-Karte] django | ||
---|---|---|---|
Zeile 11: | Zeile 11: | ||
====== Inhalt ====== | ====== Inhalt ====== | ||
+ | |||
+ | <WRAP center round alert 30%> | ||
+ | **ACHTUNG: | ||
+ | </ | ||
+ | |||
+ | |||
<WRAP center round tip 90%> | <WRAP center round tip 90%> | ||
Das Kapitel hier ist in folgende Abschnitte strukturiert. | Das Kapitel hier ist in folgende Abschnitte strukturiert. | ||
Zeile 66: | Zeile 72: | ||
Grundlegende Informationen zu **[[https:// | Grundlegende Informationen zu **[[https:// | ||
- | ==== Installation von Ansible ==== | + | ==== Installation von Ansible |
Je nach verwendeter Systemumgebung installieren wir nun das vom Paketmaintainer zur Verfügung gestellte | Je nach verwendeter Systemumgebung installieren wir nun das vom Paketmaintainer zur Verfügung gestellte | ||
- | * RPM basierende Systeme: < | + | * RPM basierende Systeme: < |
- | * DEB basierende Systeme: < | + | * DEB basierende Systeme: < |
==== Einrichten der eigenen Ansible-Umgebung ==== | ==== Einrichten der eigenen Ansible-Umgebung ==== | ||
+ | === Ansible Arbeitsverzeichnis === | ||
+ | Für unsere Ansible-Aufgaben (Playbooks) legen wir uns nun im Home-Verzeichnis unseres Admin-Users ein zugehöriges Verzeichnis an. | ||
+ | $ mkdir ~/ansible | ||
+ | |||
+ | /* | ||
=== Verzeichnis-Struktur === | === Verzeichnis-Struktur === | ||
- | Für unseren Admininstrationsuser legen wir uns zu erst einmal die passende Orderstruktur im Homeverzeichnis an. | + | Gemäß **[[http:// |
- | $ mkdir -p ~/ansible/{inventory, | + | |
- | Hieraus ergibt | + | <WRAP center round tip 90%> |
+ | Jedoch empfiehlt es sich durchaus auf Empfohlenes zurückzugreifen! So empfiehlt es sich zum Beispiel auch, Rollen anstelle von Aufgaben zu verwenden, da dies wesentlich bei der Flexibilität und besseren Organisation der eigenen Playbooks/ | ||
+ | </ | ||
+ | |||
+ | Ansible bietet **[[https:// | ||
+ | |||
+ | Mit dieser Struktur sind wir dann in der Lage jede Inventardatei mit ihrer **'' | ||
+ | |||
+ | Werfen wir also einfach mal auf die beschrieben Verzeichnisstruktur einen genaueren Blick. Die entsprechende Verwendung der einzelnen Verzeichnisse und DAteien ist in der Aufstellung entsprechend angegeben. | ||
< | < | ||
- | ├── | + | ├── |
- | └── | + | ├── library |
- | └── templates | + | ├── module_utils |
- | └── | + | │ |
+ | ├── inventories | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ └── staging | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | ├── roles # Verzeichnis für die einzelnen (unterschiedlichen) Rollen | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ ├── templates | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | └── site.yml | ||
+ | </ | ||
+ | |||
+ | Um dieses Verzeichnis-Layout einfach und schnell auf den Weg zu bringen, verwenden wir die nachfolgend gezeigten zwei Befehle bzw. genauer gesagt die beiden Befehlskette: | ||
+ | $ mkdir -p ~/ | ||
+ | ~/ | ||
+ | ~/ | ||
+ | |||
+ | $ touch ~/ | ||
+ | ~/ | ||
+ | ~/ | ||
+ | */ | ||
=== Ansible-Konfigurationsdatei === | === Ansible-Konfigurationsdatei === | ||
+ | /* | ||
Als nächstes kopieren wir uns die Vorlage-Konfiguratinsdatei aus dem Verzeichnis **''/ | Als nächstes kopieren wir uns die Vorlage-Konfiguratinsdatei aus dem Verzeichnis **''/ | ||
$ cp / | $ cp / | ||
Unter dem Konfigurationsgruppe **[ defaults ]** setzen wir den Parameter **'' | Unter dem Konfigurationsgruppe **[ defaults ]** setzen wir den Parameter **'' | ||
+ | |||
$ vim ~/ | $ vim ~/ | ||
Zeile 106: | Zeile 170: | ||
[diff] | [diff] | ||
</ | </ | ||
+ | |||
+ | :GO: | ||
+ | |||
+ | */ | ||
+ | Als nächstes kopieren wir uns die Vorlage-Konfiguratinsdatei aus dem Verzeichnis **''/ | ||
+ | $ cp / | ||
+ | |||
+ | Unter dem Konfigurationsgruppe **[ defaults ]** setzen wir den Parameter **'' | ||
+ | |||
+ | $ vim ~/ | ||
+ | |||
+ | Im Ganzen ergibt sich dann hier die doch überschaubare Konfigurationsdatei zu Ansible. | ||
+ | $ egrep -v ' | ||
+ | < | ||
+ | inventory | ||
+ | interpreter_python = auto_silent | ||
+ | [inventory] | ||
+ | [privilege_escalation] | ||
+ | [paramiko_connection] | ||
+ | [ssh_connection] | ||
+ | [persistent_connection] | ||
+ | connect_timeout = 30 | ||
+ | [accelerate] | ||
+ | [selinux] | ||
+ | [colors] | ||
+ | [diff] | ||
+ | </ | ||
+ | |||
=== Host-Definitionsdatei === | === Host-Definitionsdatei === | ||
+ | /* | ||
Ähnlich wie bereits auch schon die Konfigurationsdatei zu Ansible wird auch die Datei zur Hostdefinition sehr überschaubar bleiben. | Ähnlich wie bereits auch schon die Konfigurationsdatei zu Ansible wird auch die Datei zur Hostdefinition sehr überschaubar bleiben. | ||
Auch hier kopieren wir uns die Vorlagedatei in unser Homeverzeichnis an Ort und Stelle. | Auch hier kopieren wir uns die Vorlagedatei in unser Homeverzeichnis an Ort und Stelle. | ||
Zeile 119: | Zeile 212: | ||
raspberry-ansible | raspberry-ansible | ||
+ | |||
+ | :GO: | ||
+ | |||
+ | */ | ||
+ | Die Definition unseres Hosts mit den tzugehörigen Variablen beziehen wir später aus dem **[[# | ||
+ | |||
+ | |||
+ | |||
=== SSH Konfigurationsdatei === | === SSH Konfigurationsdatei === | ||
Zeile 124: | Zeile 225: | ||
$ vim ~/ | $ vim ~/ | ||
- | < | + | < |
| | ||
Port 22 | Port 22 | ||
Zeile 134: | Zeile 235: | ||
Beim Parameter **'' | Beim Parameter **'' | ||
+ | ==== Klonen des GIT-Repositories (Ansible-Playbook) ==== | ||
+ | |||
+ | $ cd ~/ansible | ||
+ | $ git clone https:// | ||
+ | Somit ergibt sich folgende Verzeichnis- und Dateistruktur: | ||
+ | < | ||
+ | ├── filter_plugins | ||
+ | │ └── main.yml | ||
+ | ├── inventories | ||
+ | │ ├── production | ||
+ | │ │ └── hosts.yml | ||
+ | │ └── staging | ||
+ | │ | ||
+ | ├── library | ||
+ | │ └── main.yml | ||
+ | ├── LICENSE | ||
+ | ├── module_utils | ||
+ | │ └── main.yml | ||
+ | ├── README.md | ||
+ | ├── roles | ||
+ | │ ├── basic | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── hostname.yml | ||
+ | │ │ │ ├── hosts.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── reboot.yml | ||
+ | │ │ │ ├── rfkill.yml | ||
+ | │ │ │ ├── update.yml | ||
+ | │ │ │ └── usercomment.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── hosts.j2 | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── batman | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── backport.yml | ||
+ | │ │ │ ├── batmanstart.yml | ||
+ | │ │ │ ├── compile.yml | ||
+ | │ │ │ ├── install.yml | ||
+ | │ │ │ ├── interfaceconfigure.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── modulloads.yml | ||
+ | │ │ │ ├── reboot.yml | ||
+ | │ │ │ └── utilsinstall.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── batman-adv.module.j2 | ||
+ | │ │ │ ├── dkms.j2 | ||
+ | │ │ │ ├── interfaces.j2 | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── client-mesh | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── batmanmitwifi.yml | ||
+ | │ │ │ ├── batmanohnewifi.yml | ||
+ | │ │ │ ├── clientohnemesh.yml | ||
+ | │ │ │ ├── getvxlanid.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── meshohneclient.yml | ||
+ | │ │ │ └── meshundclient.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── interfaces_client_ohne_mesh.j2 | ||
+ | │ │ │ ├── interfaces_mesh_mit_client.j2 | ||
+ | │ │ │ ├── interfaces_mesh_ohne_client.j2 | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── rclocal_both.j2 | ||
+ | │ │ │ └── rclocal_vxlan.j2 | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── common | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── ext-respondd | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── aliasgenerate.yml | ||
+ | │ │ │ ├── configgenerate.yml | ||
+ | │ │ │ ├── copyconfig.yml | ||
+ | │ │ │ ├── gitclone.yml | ||
+ | │ │ │ ├── gitinstall.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ └── servicestartup.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── ext-respondd_alias.json.j2 | ||
+ | │ │ │ ├── ext-respondd_config.json.j2 | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── fastd | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── directorygenerate.yml | ||
+ | │ │ │ ├── fastdconfigure.yml | ||
+ | │ │ │ ├── fastdgetsocket.yml | ||
+ | │ │ │ ├── fastdinstall.yml | ||
+ | │ │ │ ├── fastdkeygen.yml | ||
+ | │ │ │ ├── fastdsecretkeyget.yml | ||
+ | │ │ │ ├── fastdstartup.yml | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── fastd.j2 | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── final | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ └── reboot.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── hostapd | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── configure.yml | ||
+ | │ │ │ ├── genconfig.yml | ||
+ | │ │ │ ├── install.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── servicestartup.yml | ||
+ | │ │ │ └── wlanbridging.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── hostapd.j2 | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ └── rclocal_wifi.j2 | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── kvm_hostgen | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── generate.yml | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── kvm-new | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── oled | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── adafruitclone.yml | ||
+ | │ │ │ ├── adafruitconfig.yml | ||
+ | │ │ │ ├── i2c_arm.yml | ||
+ | │ │ │ ├── i2c-bcm2708.yml | ||
+ | │ │ │ ├── i2c-dev.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── packages.yml | ||
+ | │ │ │ ├── reboot.yml | ||
+ | │ │ │ ├── scriptclone.yml | ||
+ | │ │ │ ├── scriptconfig.yml | ||
+ | │ │ │ ├── scriptstartup.yml | ||
+ | │ │ │ └── scriptstart.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── bandwidth.j2 | ||
+ | │ │ │ ├── config.j2 | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ └── oled-bandwidth.j2 | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── vxlan | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── configure.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ └── vxlanstart.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── systemd-service-file.j2 | ||
+ | │ │ │ └── vxlan-init.j2 | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ └── wireguard | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | └── wireguard-offloader.yml | ||
+ | </ | ||
==== Kopieren des Ansible-Playbooks ==== | ==== Kopieren des Ansible-Playbooks ==== | ||
- | Nun können wir uns " | + | Nun können wir uns " |
- | * {{: | + | * **{{: |
- | * {{: | + | * //{{:centos: |
+ | * // | ||
+ | * // | ||
+ | * //{{: | ||
+ | * //{{: | ||
- | $ wget https:// | + | $ wget \ |
- | -O ansible-playbook-ffmuc-offloader-auf_basis_raspberry-4b.tar.gz | + | https:// |
+ | | ||
Anschließend entpacken wir es an Ort und Stelle. | Anschließend entpacken wir es an Ort und Stelle. | ||
Zeile 147: | Zeile 555: | ||
Somit ergibt sich folgende Verzeichnis- und Dateistruktur: | Somit ergibt sich folgende Verzeichnis- und Dateistruktur: | ||
< | < | ||
- | ├── | + | ├── |
- | │ └── hosts | + | ├── inventories |
- | └── | + | │ ├── production |
- | ├── | + | │ │ ├── group_vars |
- | ├── | + | │ │ ├── hosts.yml |
- | └── | + | │ |
- | └── | + | │ └── staging |
- | ├── | + | │ |
- | ├── batman-adv.module.j2 | + | │ |
- | ├── | + | │ |
- | ├── | + | ├── |
- | ├── ext-respondd_alias.json.j2 | + | ├── module_utils |
- | ├── ext-respondd_config.json.j2 | + | ├── roles |
- | ├── fastd.j2 | + | │ ├── basic |
- | ├── hostapd.j2 | + | │ │ ├── defaults |
- | ├── | + | │ │ │ └── main.yml |
- | ├── | + | │ │ |
- | ├── | + | │ │ │ └── main.yml |
- | ├── | + | │ │ ├── handlers |
- | ├── | + | │ │ │ |
- | ├── oled-bandwidth.j2 | + | │ │ ├── library |
- | ├── | + | │ │ ├── lookup_plugin |
- | ├── | + | │ │ ├── meta |
- | └── | + | │ │ │ |
+ | │ │ | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── hostname.yml | ||
+ | │ │ │ ├── hosts.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── reboot.yml | ||
+ | │ │ │ ├── rfkill.yml | ||
+ | │ │ │ ├── update.yml | ||
+ | │ │ │ └── usercomment.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── hosts.j2 | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── batman | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── backport.yml | ||
+ | │ │ │ ├── batmanstart.yml | ||
+ | │ │ │ ├── compile.yml | ||
+ | │ │ │ ├── install.yml | ||
+ | │ │ │ ├── interfaceconfigure.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── modulloads.yml | ||
+ | │ │ │ ├── reboot.yml | ||
+ | │ │ │ └── utilsinstall.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ | ||
+ | │ │ │ | ||
+ | │ │ │ | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── client-mesh | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── batmanmitwifi.yml | ||
+ | │ │ │ ├── batmanohnewifi.yml | ||
+ | │ │ │ ├── clientohnemesh.yml | ||
+ | │ │ │ ├── getvxlanid.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── meshohneclient.yml | ||
+ | │ │ │ └── meshundclient.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── interfaces_client_ohne_mesh.j2 | ||
+ | │ │ │ ├── interfaces_mesh_mit_client.j2 | ||
+ | │ │ │ ├── interfaces_mesh_ohne_client.j2 | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── rclocal_both.j2 | ||
+ | │ │ │ └── rclocal_vxlan.j2 | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── common | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── ext-respondd | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── aliasgenerate.yml | ||
+ | │ │ │ ├── configgenerate.yml | ||
+ | │ │ │ ├── copyconfig.yml | ||
+ | │ │ │ ├── gitclone.yml | ||
+ | │ │ │ ├── gitinstall.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ └── servicestartup.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ | ||
+ | │ │ │ | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── fastd | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── directorygenerate.yml | ||
+ | │ │ │ ├── fastdconfigure.yml | ||
+ | │ │ │ ├── fastdgetsocket.yml | ||
+ | │ │ │ ├── fastdinstall.yml | ||
+ | │ │ │ ├── fastdkeygen.yml | ||
+ | │ │ │ ├── fastdsecretkeyget.yml | ||
+ | │ │ │ ├── fastdstartup.yml | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ ├── final | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ └── reboot.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── configure.yml | ||
+ | │ │ │ ├── genconfig.yml | ||
+ | │ │ │ ├── install.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── servicestartup.yml | ||
+ | │ │ │ └── wlanbridging.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── hostapd.j2 | ||
+ | │ │ │ | ||
+ | │ │ │ └── rclocal_wifi.j2 | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── adafruitclone.yml | ||
+ | │ │ │ ├── adafruitconfig.yml | ||
+ | │ │ │ ├── i2c_arm.yml | ||
+ | │ │ │ ├── i2c-bcm2708.yml | ||
+ | │ │ │ ├── i2c-dev.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── packages.yml | ||
+ | │ │ │ ├── reboot.yml | ||
+ | │ │ │ ├── scriptclone.yml | ||
+ | │ │ │ ├── scriptconfig.yml | ||
+ | │ │ │ ├── scriptstartup.yml | ||
+ | │ │ │ └── scriptstart.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── bandwidth.j2 | ||
+ | │ │ │ | ||
+ | │ │ │ | ||
+ | │ │ │ └── oled-bandwidth.j2 | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ | ||
+ | │ │ ├── defaults | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── files | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── handlers | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── library | ||
+ | │ │ ├── lookup_plugin | ||
+ | │ │ ├── meta | ||
+ | │ │ │ └── main.yml | ||
+ | │ │ ├── module_utils | ||
+ | │ │ ├── tasks | ||
+ | │ │ │ ├── configure.yml | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ └── vxlanstart.yml | ||
+ | │ │ ├── templates | ||
+ | │ │ │ ├── main.yml | ||
+ | │ │ │ ├── systemd-service-file.j2 | ||
+ | │ │ │ └── vxlan-init.j2 | ||
+ | │ │ └── vars | ||
+ | │ │ | ||
+ | │ └── wireguard | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | └── wireguard-offloader.yml | ||
+ | </ | ||
+ | ==== Aufbau des Ansible-Playbooks - Inhalte ==== | ||
Nachfolgend finden wir die Inhalte der einzelnen Dateien die im ansible-playbook enthalten sind: | Nachfolgend finden wir die Inhalte der einzelnen Dateien die im ansible-playbook enthalten sind: | ||
- | === raspi_offloader_file.yml === | + | === Inventory-Definition === |
- | <file java raspi_offloader_file.yml> | + | <file java ~/ |
- | - name: | + | ffmuc: |
- | hosts: | + | children: |
+ | ffmuc_deb: | ||
+ | vars: | ||
+ | ansible_ssh_user: | ||
+ | hosts: | ||
+ | raspberry-wireguard: | ||
+ | wireguard_ports: | ||
+ | muc_cty: | ||
+ | muc_nord: | ||
+ | muc_ost: | ||
+ | muc_sued: | ||
+ | muc_west: | ||
+ | uml_nord: | ||
+ | uml_ost: | ||
+ | uml_sued: | ||
+ | uml_west: | ||
+ | gauting: | ||
+ | freising: | ||
+ | welt: | ||
+ | vxlan_ids: | ||
+ | muc_cty: | ||
+ | muc_nord: | ||
+ | muc_ost: | ||
+ | muc_sued: | ||
+ | muc_west: | ||
+ | uml_nord: | ||
+ | uml_ost: | ||
+ | uml_sued: | ||
+ | uml_west: | ||
+ | gauting: | ||
+ | freising: | ||
+ | welt: | ||
+ | gw_linklocal: | ||
+ | gw04: " | ||
+ | gw05: " | ||
+ | gw06: " | ||
+ | gw07: " | ||
+ | gw_publickey: | ||
+ | gw04: " | ||
+ | gw05: " | ||
+ | gw06: " | ||
+ | gw07: " | ||
+ | gw_vxlan_ids: | ||
+ | muc_cty: | ||
+ | muc_nord: | ||
+ | muc_ost: | ||
+ | muc_sued: | ||
+ | muc_west: | ||
+ | uml_nord: | ||
+ | uml_ost: | ||
+ | uml_sued: | ||
+ | uml_west: | ||
+ | gauting: | ||
+ | freising: | ||
+ | welt: | ||
+ | batman_adv_version: | ||
+ | ffmuc_segment: | ||
+ | ffmuc_gateway: | ||
+ | raspberry_hostname: | ||
+ | node_contact_address: | ||
+ | raspberry_latitude: | ||
+ | raspberry_longitude: | ||
+ | raspberry_wifi: | ||
+ | raspberry_clientvlan: | ||
+ | raspberry_meshvlan: | ||
+ | raspberry_oled: | ||
+ | dtparam: | ||
+ | ... #YAML ende syntax (optional) | ||
+ | </ | ||
+ | |||
+ | |||
+ | === Playbook " | ||
+ | <file java ~/ | ||
+ | - name: | ||
+ | hosts: | ||
become: | become: | ||
become_user: | become_user: | ||
- | | + | |
- | | + | |
- | muc_cty: | + | |
- | muc_nord: 30003 | + | |
- | muc_ost: | + | |
- | muc_sued: 30005 | + | |
- | muc_west: 30006 | + | |
- | uml_nord: 30007 | + | |
- | uml_ost: | + | |
- | uml_sued: 30009 | + | |
- | uml_west: 30010 | + | |
- | gauting: | + | |
- | freising: 30013 | + | |
- | welt: | + | |
- | | + | |
- | muc_cty: | + | |
- | muc_nord: 15521492 | + | |
- | muc_ost: | + | |
- | muc_sued: 8599288 | + | |
- | muc_west: 7318933 | + | |
- | uml_nord: 5705961 | + | |
- | uml_ost: | + | |
- | uml_sued: 16544703 | + | |
- | uml_west: 16677749 | + | |
- | gauting: | + | |
- | freising: 12937858 | + | |
- | welt: | + | |
- | batman_adv_version: | + | |
- | ffmuc_segment: | + | |
- | | + | |
- | | + | |
- | | + | |
- | raspberry_longitude: | + | |
- | | + | |
- | | + | |
- | raspberry_meshvlan: | + | |
- | | + | |
- | | + | |
- | tasks: | + | ... # YML Ende |
- | - name: Hostname ändern | + | </ |
- | shell: hostnamectl set-hostname {{ raspberry_hostname }} | + | |
- | | + | === Rolle " |
- | | + | == Tasks == |
- | src: Raspbian/ | + | <file java ~/ |
- | dest: /etc/hosts | + | - include: hostname.yml |
+ | - include: hosts.yml | ||
+ | - include: usercomment.yml | ||
+ | - include: rfkill.yml # Service rfkill bei Raspberry Pi OS deaktivieren | ||
+ | - include: update.yml | ||
+ | - include: reboot.yml | ||
+ | </file> | ||
- | | + | <file java ~/ |
- | user: | + | |
- | name: pi | + | # https:// |
- | | + | shell: |
- | | + | cmd: hostnamectl set-hostname {{ raspberry_hostname }} |
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
+ | # https:// | ||
+ | template: | ||
+ | | ||
+ | dest: / | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | | + | # https:// |
- | | + | user: |
+ | | ||
+ | | ||
+ | state: present | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
+ | # https:// | ||
+ | shell: | ||
+ | | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | url: https://downloads.open-mesh.org/batman/releases/batman-adv-{{ batman_adv_version }}/batman-adv-{{ batman_adv_version }}.tar.gz | + | # |
- | dest: / | + | apt: |
- | mode: ' | + | |
+ | update_cache: | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | src: /usr/src/batman-adv-{{ batman_adv_version | + | # https:// |
- | dest: /usr/src | + | |
- | | + | </file> |
+ | == Templates == | ||
+ | <file java ~/ansible/roles/ | ||
+ | :: | ||
+ | ff02:: | ||
+ | ff02:: | ||
+ | </file> | ||
+ | === Rolle " | ||
+ | == Tasks == | ||
+ | <file java ~/ansible/ | ||
+ | - include: install.yml | ||
+ | - include: compile.yml | ||
+ | - include: modulloads.yml | ||
+ | - include: backport.yml | ||
+ | - include: utilsinstall.yml | ||
+ | - include: batmanstart.yml | ||
+ | - include: interfaceconfigure.yml | ||
+ | - include: reboot.yml | ||
+ | </ | ||
- | | + | <file java ~/ |
- | apt: | + | |
- | | + | # https:// |
- | pkg: | + | |
- | | + | url: https:// |
- | | + | dest: / |
- | state: present | + | mode: ' |
- | | + | |
- | make: | + | # https:// |
- | chdir: /usr/src/linux-headers-{{ ansible_kernel | + | |
- | | + | src: /usr/src/batman-adv-{{ batman_adv_version |
- | | + | dest: /usr/src |
+ | | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | src: Raspbian/dkms.j2 | + | # https:// |
- | | + | apt: |
+ | | ||
+ | pkg: | ||
+ | - dkms | ||
+ | - raspberrypi-kernel-headers | ||
+ | state: present | ||
- | | + | |
- | #become: yes | + | # https:// |
- | | + | make: |
- | | + | |
- | | + | |
- | changed_when: | + | |
- | | + | |
- | #become: yes | + | # https:// |
- | | + | template: |
+ | | ||
+ | dest: /usr/src/batman-adv-{{ batman_adv_version }}/dkms.conf | ||
- | | + | |
- | #become: yes | + | # https:// |
- | command: dkms install | + | command: dkms add -m batman-adv -v {{ batman_adv_version }} |
+ | register: ret | ||
+ | failed_when: | ||
+ | changed_when: | ||
- | | + | |
- | template: | + | # https://docs.ansible.com/ansible/ |
- | src: Raspbian/batman-adv.module.j2 | + | command: dkms build -m batman-adv |
- | dest: /etc/modules-load.d/batman-adv.module.conf | + | |
- | | + | |
- | #become: yes | + | # https:// |
- | | + | |
- | name: batman_adv | + | </ |
- | state: present | + | |
- | | + | <file java ~/ |
- | #become: yes | + | |
- | | + | # https:// |
- | name: dummy | + | |
- | state: present | + | src: templates/ |
+ | dest: / | ||
- | | + | |
- | apt: | + | # https:// |
- | | + | |
- | pkg: | + | name: dummy |
- | - batctl | + | state: present |
- | - bridge-utils | + | |
- | | + | |
- | | + | |
- | | + | # https:// |
+ | modprobe: | ||
+ | | ||
+ | state: present | ||
+ | </ | ||
- | | + | <file java ~/ |
- | template: | + | |
- | src: Raspbian/interfaces.j2 | + | # https://docs.ansible.com/ |
- | dest: /etc/network/ | + | |
+ | cmd: apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net: | ||
- | | + | |
- | #become: yes | + | # https:// |
- | apt: | + | shell: |
- | name: fastd | + | cmd: apt-key adv --keyserver hkp:// |
- | state: present | + | |
- | | + | |
- | file: | + | # https://docs.ansible.com/ansible/ |
- | path: /etc/fastd/{{ ffmuc_segment }} | + | shell: |
- | state: directory | + | cmd: echo "deb http:// |
- | | + | |
- | shell: fastd --generate-key > /root/fastd.key | + | # https://docs.ansible.com/ |
+ | apt: | ||
+ | update_cache: | ||
+ | </ | ||
- | | + | <file java ~/ |
- | shell: grep Secret | + | |
- | | + | # https://docs.ansible.com/ansible/latest/ |
+ | apt: | ||
+ | # | ||
+ | pkg: | ||
+ | - bridge-utils | ||
+ | - dnsutils | ||
+ | - vim | ||
+ | | ||
- | | + | |
- | | + | # https:// |
- | | + | apt: |
- | | + | |
- | | + | pkg: |
+ | | ||
+ | default_release: buster-backports | ||
+ | | ||
+ | </ | ||
- | | + | <file java ~/ |
- | template: | + | |
- | src: Raspbian/fastd.j2 | + | # https://docs.ansible.com/ansible/latest/modules/shell_module.html |
- | dest: /etc/fastd/{{ ffmuc_segment }}/fastd.conf | + | shell: |
+ | cmd: batctl ra BATMAN_V | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | name: fastd@{{ ffmuc_segment }} | + | # https:// |
- | state: started | + | |
- | | + | src: templates/ |
+ | dest: / | ||
+ | </ | ||
- | | + | <file java ~/ |
- | apt: | + | |
- | | + | # https:// |
- | | + | |
- | - git | + | </ |
- | - python3-netifaces | + | |
- | state: present | + | |
- | - name: Repo ext-respondd klonen | + | == Templates == |
- | | + | <file java ~/ansible/roles/batman/templates/ |
- | repo: https://github.com/freifunkMUC/ext-respondd | + | # Load batman-adv module on system boot |
- | dest: /opt/ext-respondd/ | + | # |
+ | batman-adv | ||
+ | dummy | ||
+ | </file> | ||
- | - name: Systemd Startdatei für respondd kopieren | + | <file java ~/ansible/roles/batman/templates/dkms.j2> |
- | shell: cp /opt/ext-respondd/ext-respondd.service.example | + | PACKAGE_VERSION={{ batman_adv_version }} |
- | - name: Erstellen der resondd Konfigurationsdatei alias.json | + | DEST_MODULE_LOCATION=/ |
- | | + | BUILT_MODULE_NAME=batman-adv |
- | src: Raspbian/ | + | BUILT_MODULE_LOCATION=net/batman-adv |
- | | + | |
- | - name: Erstellen der resondd Konfigurationsdatei config.json | + | MAKE="' |
- | | + | CLEAN="' |
- | src: Raspbian/ | + | |
- | dest: / | + | |
- | - name: Service ext-respondd beim Booten starten | + | AUTOINSTALL=" |
- | systemd: | + | </ |
- | name: ext-respondd | + | |
- | daemon_reload: | + | |
- | | + | |
- | enabled: yes | + | |
- | - name: Paket hostapd für WLAN installieren | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - hostapd | ||
- | state: present | ||
- | when: ( raspberry_wifi == " | ||
- | - name: hostapd konfigurieren | + | <file java ~/ansible/roles/batman/ |
- | shell: echo ' | + | |
- | when: ( raspberry_wifi == " | + | |
- | - name: hostapd Konfigurationsdatei anlegen | + | # Please note that this file is written to be used with dhcpcd |
- | | + | # For static IP, consult |
- | src: Raspbian/ | + | |
- | dest: /etc/hostapd/ | + | |
- | when: ( raspberry_wifi == " | + | |
- | - name: wlan0 in Bridge packen | + | # Include files from /etc/ |
- | template: | + | # source-directory |
- | src: Raspbian/rclocal_wifi.j2 | + | |
- | | + | |
- | when: ( raspberry_wifi == " | + | |
- | | + | auto eth0 |
- | | + | iface eth0 inet dhcp |
- | | + | |
- | | + | auto br-{{ ffmuc_segment }} |
- | | + | iface br-{{ ffmuc_segment }} inet dhcp |
- | | + | |
- | when: ( raspberry_wifi == " | + | |
+ | | ||
+ | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | | ||
+ | </ | ||
- | - name: Konfiguration des Client-VLAN ohne Mesh-Netz | ||
- | template: | ||
- | src: Raspbian/ | ||
- | dest: / | ||
- | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length == 0 ) | ||
- | | + | === Rolle " |
- | | + | == Tasks == |
- | | + | <file java ~/ |
- | loop: "{{ lookup(' | + | - include: install.yml |
- | when: " | + | - include: genkeys.yml |
+ | - include: genlinklocal.yml # lokale link-local IPv6 Adresse generieren | ||
+ | - include: configuration.yml | ||
+ | - include: brokerinform.yml # Public-Key unseres Nodes an den Broker übermitteln | ||
+ | - include: wireguardstart.yml | ||
+ | - include: checkup.yml | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | - name: " |
- | src: Raspbian/interfaces_mesh_ohne_client.j2 | + | # https://docs.ansible.com/ansible/latest/modules/ |
- | dest: /etc/network/interfaces | + | apt: |
- | | + | |
+ | pkg: | ||
+ | - wireguard | ||
+ | state: present | ||
+ | </file> | ||
- | | + | <file java ~/ |
- | | + | - name: " |
- | src: Raspbian/interfaces_mesh_mit_client.j2 | + | # https:// |
- | dest: /etc/network/interfaces | + | |
- | | + | args: |
+ | chdir: /etc/wireguard/ | ||
+ | | ||
- | | + | |
- | | + | # https:// |
- | src: Raspbian/rclocal_vxlan.j2 | + | file: |
- | dest: /etc/rc.local | + | path: /etc/wireguard/ |
- | | + | |
- | | + | |
- | | + | # https://docs.ansible.com/ |
- | src: Raspbian/rclocal_both.j2 | + | file: |
- | dest: /etc/rc.local | + | path: /etc/wireguard/ |
- | | + | |
+ | </file> | ||
- | | + | <file java ~/ |
- | shell: | + | |
- | when: ( raspberry_oled == " | + | # https:// |
+ | shell: | ||
+ | register: wg_node_linklocal | ||
+ | </ | ||
- | | + | <file java ~/ |
- | shell: | + | |
- | when: ( raspberry_oled == " | + | # https://docs.ansible.com/ |
+ | shell: | ||
+ | | ||
- | | + | |
- | apt: | + | # https:// |
- | | + | shell: cat / |
- | pkg: | + | |
- | - python3-dev | + | |
- | - python3-smbus | + | |
- | - i2c-tools | + | |
- | - python3-pil | + | |
- | - python3-pip | + | |
- | - python3-setuptools | + | |
- | - python3-rpi.gpio | + | |
- | - git | + | |
- | - fonts-freefont-ttf | + | |
- | state: present | + | |
- | when: ( raspberry_oled == " | + | |
- | | + | |
- | template: | + | # https://docs.ansible.com/ansible/latest/ |
- | src: Raspbian/config.j2 | + | set_fact: |
- | dest: /boot/config.txt | + | |
- | | + | loop: "{{ lookup(' |
+ | when: " | ||
- | | + | |
- | | + | # https:// |
- | | + | set_fact: |
+ | | ||
+ | loop: "{{ lookup(' | ||
+ | when: " | ||
- | | + | |
- | git: | + | # |
- | | + | set_fact: |
- | dest: /usr/local/src/Adafruit_Python_SSD1306 | + | |
- | | + | loop: "{{ lookup(' |
+ | when: " | ||
- | | + | |
- | shell: cd /usr/local/src/Adafruit_Python_SSD1306 && python3 setup.py install | + | # https://docs.ansible.com/ansible/ |
- | | + | template: |
+ | | ||
+ | | ||
+ | </ | ||
- | | + | <file java ~/ |
- | git: | + | |
- | | + | # https://docs.ansible.com/ansible/latest/modules/template_module.html |
- | dest: /usr/local/src/raspberry-oled-bandwidth | + | template: |
- | | + | |
+ | | ||
- | | + | |
- | template: | + | # https://docs.ansible.com/ansible/latest/modules/systemd_module.html |
- | src: Raspbian/bandwidth.j2 | + | systemd: |
- | dest: /usr/local/src/raspberry-oled-bandwidth/ | + | |
- | | + | daemon_reload: |
+ | state: started | ||
+ | enabled: yes | ||
+ | </ | ||
- | | + | <file java ~/ |
- | template: | + | |
- | src: Raspbian/oled-bandwidth.j2 | + | # https://docs.ansible.com/ansible/latest/modules/systemd_module.html |
- | dest: /etc/systemd/system/oled-bandwidth.service | + | systemd: |
- | | + | |
+ | daemon_reload: | ||
+ | state: started | ||
+ | enabled: yes | ||
+ | </ | ||
- | | + | <file java ~/ |
- | systemd: | + | |
- | name: oled-bandwidth | + | # https:// |
- | | + | shell: cat / |
- | state: started | + | |
- | enabled: yes | + | |
- | when: ( raspberry_oled == " | + | |
- | | + | |
- | | + | # https:// |
+ | template: | ||
+ | src: templates/ | ||
+ | | ||
+ | - name: " | ||
+ | # https:// | ||
+ | file: | ||
+ | path: / | ||
+ | mode: ' | ||
- | ... #YAML Ende Syntax</ | + | - name: " |
+ | # https:// | ||
+ | template: | ||
+ | src: templates/ | ||
+ | dest: / | ||
+ | </ | ||
- | === raspi_offloader_menu.yml === | + | == Templates |
- | <file java raspi_offloader_menu.yml>--- ### Ansible Playbook für menügeführte Konfiguration eines Offloader auf Basis eines Raspberry PI 4B | + | <file java ~/ |
- | - name: raspi_offloader_menu.yml | + | [Unit] |
- | hosts: | + | # see man systemd.unit |
- | become: yes | + | Description=Inform tunnel about our wireguard-public key |
- | | + | Documentation=https://wiki.mailserver.guru/ |
+ | Before=wg-quick.target | ||
- | vars: | + | [Service] |
- | | + | # see man systemd.service, |
- | | + | ExecStart=/ |
- | muc_nord: 30003 | + | StandardOutput=syslog |
- | muc_ost: 30004 | + | StandardError=syslog |
- | | + | |
- | | + | |
- | uml_nord: 30007 | + | |
- | uml_ost: | + | |
- | uml_sued: 30009 | + | |
- | uml_west: 30010 | + | |
- | gauting: | + | |
- | freising: 30013 | + | |
- | welt: 30011 | + | |
- | vxlan_ids: | + | |
- | muc_cty: | + | |
- | muc_nord: 15521492 | + | |
- | muc_ost: | + | |
- | muc_sued: 8599288 | + | |
- | muc_west: 7318933 | + | |
- | uml_nord: 5705961 | + | |
- | uml_ost: | + | |
- | uml_sued: 16544703 | + | |
- | uml_west: 16677749 | + | |
- | gauting: | + | |
- | freising: 12937858 | + | |
- | welt: | + | |
- | dtparam: | + | |
- | vars_prompt: | + | [Install] |
- | - name: batman_adv_version | + | WantedBy=default.target |
- | | + | </file> |
- | private: no | + | |
- | - name: ffmuc_segment | + | <file java ~/ |
- | prompt: "\nIn welchem der Segmente hier soll der Offloader betrieben werden: \n muc_cty \n muc_nord \n muc_ost \n muc_sued \n muc_west \n uml_nord \n uml_ost \n uml_sued \n uml_west \n gauting \n freising \n welt " | + | |
- | private: no | + | |
- | | + | # Check connectivity to supernode |
- | | + | HTTP_STATUS_CODE=(`curl |
- | | + | if [ ${HTTP_STATUS_CODE} != " |
+ | logger -t checkuplink "curl --silent --interface wg-uplink --get --ipv6 --connect-timeout 5 --write-out ' | ||
+ | logger -t checkuplink "... better we restart the wireguar-tunnel!" | ||
+ | ip link set nomaster bat-{{ ffmuc_segment }} dev vxlan-mesh &> /dev/null | ||
+ | ip link del dev mesh-vpn &> /dev/null | ||
+ | ip link del wg-uplink &> /dev/null | ||
+ | systemctl stop wg-quick@wg-uplink | ||
+ | systemctl restart networking | ||
+ | logger -t checkuplink " | ||
+ | / | ||
+ | logger -t checkuplink " | ||
+ | systemctl start wg-quick@wg-uplink | ||
+ | logger -t checkuplink " | ||
+ | vxlan | ||
+ | else | ||
+ | #logger -t checkuplink " | ||
+ | fi | ||
+ | </ | ||
- | - name: node_contact_address | + | <file java ~/ |
- | prompt: "\nWie lautet die Kontakt-Adresse des Node-Betreibers? | + | # Unlike any other crontab you don't have to run the `crontab' |
- | | + | # command to install the new version when you edit this file |
+ | # and files in / | ||
+ | # that none of the other crontabs do. | ||
- | - name: raspberry_latitude | + | SHELL=/ |
- | | + | PATH=/ |
- | private: no | + | |
- | | + | # Example of job definition: |
- | | + | # .---------------- minute (0 - 59) |
- | | + | # | .------------- hour (0 - 23) |
+ | # | | .---------- day of month (1 - 31) | ||
+ | # | | | .------- month (1 - 12) OR jan, | ||
+ | # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun, | ||
+ | # | | | | | | ||
+ | # * * * * * user-name command to be executed | ||
+ | 17 * * * * root | ||
+ | 25 6 * * * root test -x / | ||
+ | 47 6 * * 7 root test -x / | ||
+ | 52 6 1 * * root test -x / | ||
+ | # | ||
- | | + | # check wireguard-connection |
- | | + | * * * * * root / |
- | | + | </ |
- | - name: raspberry_clientvlan | + | <file java ~/ |
- | | + | PrivateKey = {{ wg_client_privatekey.stdout }} |
- | | + | Address = {{ wg_node_linklocal.stdout }} |
- | - name: raspberry_meshvlan | + | [Peer] |
- | | + | PublicKey = {{ ffmuc_wireguard_gwpubkey }} |
- | | + | AllowedIPs = {{ ffmuc_wireguard_linklocal }} |
+ | Endpoint = {{ ffmuc_gateway }}.ext.ffmuc.net:{{ ffmuc_wireguard_port }} | ||
+ | PersistentKeepalive = 25 | ||
+ | </ | ||
- | - name: raspberry_oled | ||
- | prompt: "\nIst ein OLE-Display an dem Raspberry Offloader angeschlossen? | ||
- | private: no | ||
- | | + | === Rolle " |
- | - name: Hostname ändern | + | <file java ~/ |
- | shell: hostnamectl set-hostname {{ raspberry_hostname }} | + | - include: configure.yml |
+ | - include: vxlanstart.yml | ||
+ | </ | ||
- | | + | == Tasks == |
- | template: | + | <file java ~/ |
- | src: Raspbian/hosts.j2 | + | # https://docs.ansible.com/ansible/latest/ |
- | dest: /etc/hosts | + | command: ip6tables -I INPUT 1 -i wg-uplink -m udp -p udp --dport 8472 -j ACCEPT |
- | | + | |
- | user: | + | # https:// |
- | name: pi | + | |
- | | + | |
- | state: present | + | loop: "{{ lookup(' |
+ | when: " | ||
- | | + | |
- | | + | # https:// |
+ | set_fact: | ||
+ | | ||
+ | loop: "{{ lookup(' | ||
+ | when: " | ||
- | | + | |
- | apt: | + | # https:// |
- | | + | |
- | | + | |
- | | + | |
- | | + | # https:// |
+ | template: | ||
+ | src: templates/ | ||
+ | | ||
- | | + | |
- | | + | # |
- | url: https://downloads.open-mesh.org/batman/releases/batman-adv-{{ batman_adv_version }}/batman-adv-{{ batman_adv_version }}.tar.gz | + | |
- | dest: /usr/src/batman-adv-{{ batman_adv_version }}.tar.gz | + | path: /usr/local/bin/vxlan |
- | mode: '0644' | + | mode: '0740' |
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | src: /usr/ | + | # https:// |
- | dest: /usr/src | + | |
- | remote_src: yes | + | |
+ | dest: /etc/systemd/ | ||
- | | + | |
- | apt: | + | # https:// |
- | | + | |
- | pkg: | + | |
- | - dkms | + | |
- | - raspberrypi-kernel-headers | + | |
- | state: present | + | |
- | | + | |
- | make: | + | # https://docs.ansible.com/ansible/ |
- | chdir: /usr/src/linux-headers-{{ ansible_kernel }} | + | |
- | | + | |
- | | + | daemon_reload: yes |
+ | state: started | ||
+ | enabled: yes | ||
+ | </ | ||
- | - name: Anlegen der dkms.conf für Dynamic Kernel Module Support | + | == Templates == |
- | | + | <file java ~/ansible/ |
- | src: Raspbian/dkms.j2 | + | # see man systemd.unit |
- | dest: /usr/src/batman-adv-{{ batman_adv_version }}/dkms.conf | + | Description=Bringing up VXLAN Interface |
+ | Documentation=https://wiki.mailserver.guru/doku.php/ | ||
+ | After=wg-quick@wg-uplink.service | ||
- | - name: Dynamic Kernel Module Support hinzufügen | + | [Service] |
- | #become: yes | + | # see man systemd.service, |
- | | + | Type=oneshot |
- | | + | ExecStart=/ |
- | | + | StandardOutput=syslog |
- | | + | StandardError=syslog |
- | | + | [Install] |
- | # | + | WantedBy=multi-user.target |
- | command: dkms build -m batman-adv -v {{ batman_adv_version }} | + | </ |
- | | + | <file bash ~/ |
- | | + | |
- | command: dkms install -m batman-adv -v {{batman_adv_version }} | + | |
- | - name: Laden des Kernelmodul beim Booten veranlassen | + | # Bring up VXLAN |
- | | + | ip link add mesh-vpn type vxlan id {{ ffmuc_vxlan_id }} local {{ wg_node_linklocal.stdout }} remote {{ ffmuc_wireguard_linklocal }} dstport 8472 dev wg-uplink |
- | src: Raspbian/ | + | ip link set up dev mesh-vpn |
- | dest: / | + | |
- | | + | # Bind mesh-vpn to BATMAN-Device |
- | # | + | / |
- | modprobe: | + | |
- | name: batman_adv | + | |
- | state: present | + | |
- | - name: Laden des dummy Moduls | + | # If we have a BATMAN_V env we need to correct the throughput value now |
- | | + | / |
- | | + | </ |
- | name: dummy | + | |
- | | + | |
- | - name: Installation der bridge-utils | ||
- | apt: | ||
- | update_cache: | ||
- | pkg: | ||
- | - batctl | ||
- | - bridge-utils | ||
- | state: present | ||
- | - name: Aktivierung von BATMAN_V | ||
- | shell: batctl ra BATMAN_V | ||
- | | + | === Rolle "ext-respondd" |
- | | + | == Tasks == |
- | src: Raspbian/ | + | <file java ~/ |
- | dest: /etc/ | + | - include: gitinstall.yml |
+ | - include: gitclone.yml # Repo ext-respondd klonen | ||
+ | - include: copyconfig.yml | ||
+ | - include: aliasgenerate.yml | ||
+ | - include: configgenerate.yml | ||
+ | - include: servicestartup.yml | ||
+ | </file> | ||
- | | + | <file java ~/ |
- | #become: yes | + | |
- | apt: | + | # https:// |
- | name: fastd | + | |
- | state: present | + | src: templates/ |
+ | dest: / | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | path: /etc/fastd/{{ ffmuc_segment }} | + | # https:// |
- | | + | template: |
+ | | ||
+ | dest: /opt/ext-respondd/config.json | ||
+ | </ | ||
- | | + | <file java ~/ |
- | shell: | + | |
+ | # https:// | ||
+ | | ||
+ | cmd: cp /opt/ext-respondd/ | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | | + | # https://docs.ansible.com/ |
+ | git: | ||
+ | | ||
+ | | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | | + | # https:// |
- | | + | apt: |
- | | + | |
+ | | ||
+ | - git | ||
+ | - python3-netifaces | ||
+ | state: present | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | src: Raspbian/fastd.j2 | + | # https://docs.ansible.com/ansible/latest/modules/systemd_module.html |
- | dest: /etc/fastd/{{ ffmuc_segment }}/fastd.conf | + | systemd: |
+ | name: ext-respondd | ||
+ | daemon_reload: | ||
+ | state: started | ||
+ | enabled: yes | ||
+ | </ | ||
- | | + | == Templates == |
- | | + | <file java ~/ |
- | name: fastd@{{ ffmuc_segment }} | + | " |
- | state: started | + | " |
- | | + | " |
+ | | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | </ | ||
- | | + | <file java ~/ |
- | apt: | + | " |
- | | + | " |
- | pkg: | + | " |
- | | + | " |
- | - python3-netifaces | + | " |
- | state: present | + | " |
+ | } | ||
+ | </ | ||
- | - name: Repo ext-respondd klonen | ||
- | git: | ||
- | repo: https:// | ||
- | dest: / | ||
- | | + | === Rolle " |
- | shell: cp /opt/ext-respondd/ | + | == Tasks == |
+ | <file java ~/ | ||
+ | - include: install.yml | ||
+ | - include: configure.yml | ||
+ | - include: genconfig.yml # hostapd Konfigurationsdatei anlegen | ||
+ | - include: wlanbridging.yml # wlan0 in Bridge packen | ||
+ | - include: servicestartup.yml # Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | src: Raspbian/ext-respondd_alias.json.j2 | + | # https://docs.ansible.com/ |
- | dest: /opt/ext-respondd/alias.json | + | shell: echo ' |
+ | when: ( raspberry_wifi == " | ||
+ | </ | ||
- | | + | <file java ~/ |
- | template: | + | |
- | src: Raspbian/ext-respondd_config.json.j2 | + | # https:// |
- | dest: /opt/ext-respondd/config.json | + | template: |
+ | src: templates/hostapd.j2 | ||
+ | dest: /etc/hostapd/hostapd.conf | ||
+ | when: ( raspberry_wifi == " | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | name: ext-respondd | + | # https:// |
- | | + | apt: |
- | state: | + | |
- | | + | pkg: |
+ | | ||
+ | | ||
+ | when: ( raspberry_wifi == " | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | | + | # https:// |
- | pkg: | + | systemd: |
- | - hostapd | + | |
- | | + | |
- | when: ( raspberry_wifi == " | + | |
+ | state: | ||
+ | when: ( raspberry_wifi == " | ||
+ | </ | ||
- | | + | <file java ~/ |
- | shell: echo ' | + | |
- | when: ( raspberry_wifi == " | + | # https://docs.ansible.com/ansible/ |
+ | template: | ||
+ | | ||
+ | dest: / | ||
+ | | ||
+ | </ | ||
- | - name: hostapd Konfigurationsdatei anlegen | + | == Templates == |
- | template: | + | <file java ~/ansible/roles/hostapd/templates/hostapd.j2>ssid=muenchen.freifunk.net/ |
- | src: Raspbian/hostapd.j2 | + | |
- | dest: /etc/ | + | |
- | when: ( raspberry_wifi | + | |
- | - name: wlan0 in Bridge packen | + | country_code=US |
- | template: | + | |
- | src: Raspbian/ | + | |
- | dest: / | + | |
- | when: ( raspberry_wifi | + | |
- | - name: Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen | + | interface=wlan0 |
- | | + | driver=nl80211 |
- | name: hostapd | + | |
- | enabled: yes | + | |
- | masked: no | + | |
- | state: started | + | |
- | when: ( raspberry_wifi == " | + | |
- | - name: Konfiguration des Client-VLAN ohne Mesh-Netz | + | macaddr_acl=0 |
- | template: | + | |
- | src: Raspbian/ | + | |
- | dest: / | + | |
- | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length == 0 ) | + | |
- | - name: vxlan_id für ausgewähltes Segment ermitteln | + | logger_syslog=0 |
- | | + | logger_syslog_level=4 |
- | | + | logger_stdout=-1 |
- | loop: "{{ lookup(' | + | logger_stdout_level=0 |
- | when: " | + | |
- | - name: Konfiguration des Mesh-VLAN ohne Client-VLAN | + | hw_mode=a |
- | | + | wmm_enabled=1 |
- | src: Raspbian/ | + | |
- | dest: / | + | |
- | when: ( raspberry_clientvlan|length == 0 ) and ( raspberry_meshvlan|length > 0 ) | + | |
- | - name: Konfiguration von Mesh- und Client-VLAN | + | # N |
- | | + | ieee80211n=1 |
- | src: Raspbian/ | + | require_ht=1 |
- | dest: / | + | ht_capab=[MAX-AMSDU-3839][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40] |
- | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length > 0 ) | + | |
- | | + | # AC |
- | | + | ieee80211ac=1 |
- | src: Raspbian/ | + | require_vht=1 |
- | dest: / | + | ieee80211d=0 |
- | when: ( raspberry_meshvlan|length | + | ieee80211h=0 |
+ | vht_capab=[MAX-AMSDU-3839][SHORT-GI-80] | ||
+ | vht_oper_chwidth=1 | ||
+ | channel=36 | ||
+ | vht_oper_centr_freq_seg0_idx=42 | ||
+ | </file> | ||
- | - name: Konfiguration des bevorzugte Meshingpoint in BATMAN_V mit Wifi-Nutzung | + | <file java ~/ansible/ |
- | template: | + | # |
- | src: Raspbian/rclocal_both.j2 | + | # rc.local |
- | dest: /etc/rc.local | + | # |
- | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi == "ja" ) | + | # This script is executed at the end of each multiuser runlevel. |
+ | # Make sure that the script will " | ||
+ | # value on error. | ||
+ | # | ||
+ | # In order to enable or disable this script just change the execution | ||
+ | # bits. | ||
+ | # | ||
+ | # By default this script does nothing. | ||
- | - name: Für OLED-Konfiguration i2c-bcm2708 in / | + | # Print the IP address |
- | | + | _IP=$(hostname |
- | when: ( raspberry_oled == "ja" | + | if [ "$_IP" |
+ | printf "My IP address is %s\n" " | ||
+ | fi | ||
+ | sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | ||
+ | exit 0 | ||
+ | </ | ||
- | - name: Für OLED-Konfiguration i2c-dev in / | ||
- | shell: echo i2c-dev >> / | ||
- | when: ( raspberry_oled == " | ||
- | | + | === Rolle " |
- | apt: | + | == Tasks == |
- | | + | <file java ~/ |
- | pkg: | + | - include: clientohnemesh.yml |
- | | + | - include: getvxlanid.yml |
- | | + | - include: meshohneclient.yml |
- | - i2c-tools | + | - include: meshundclient.yml |
- | - python3-pil | + | - include: batmanohnewifi.yml # Konfiguration des bevorzugte Meshingpoint in BATMAN_V ohne Wifi-Nutzung |
- | - python3-pip | + | - include: batmanmitwifi.yml |
- | - python3-setuptools | + | </ |
- | | + | |
- | | + | |
- | - fonts-freefont-ttf | + | |
- | | + | |
- | when: ( raspberry_oled == " | + | |
- | | + | <file java ~/ |
- | template: | + | |
- | src: Raspbian/config.j2 | + | # https:// |
- | dest: /boot/config.txt | + | |
- | when: ( raspberry_oled | + | src: templates/rclocal_both.j2 |
+ | dest: /etc/rc.local | ||
+ | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | when: ( raspberry_oled == " | + | # https:// |
+ | template: | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
- | | + | <file java ~/ |
- | git: | + | --- |
- | repo: https://github.com/adafruit/Adafruit_Python_SSD1306.git | + | - name: " |
- | dest: /usr/local/src/ | + | # https://docs.ansible.com/ansible/latest/ |
- | when: ( raspberry_oled | + | |
+ | src: templates/ | ||
+ | | ||
+ | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length | ||
+ | </ | ||
- | | + | <file java ~/ |
- | shell: cd /usr/local/src/Adafruit_Python_SSD1306 && python3 setup.py install | + | |
- | | + | # https://docs.ansible.com/ansible/latest/ |
+ | set_fact: | ||
+ | | ||
+ | loop: "{{ lookup(' | ||
+ | when: " | ||
+ | </ | ||
- | | + | <file java ~/ |
- | | + | |
- | repo: https://github.com/awlx/raspberry-oled-bandwidth | + | # |
- | dest: /usr/local/src/ | + | |
- | when: ( raspberry_oled | + | src: templates/ |
+ | | ||
+ | when: ( raspberry_clientvlan|length | ||
+ | </ | ||
- | | + | <file java ~/ |
- | template: | + | |
- | src: Raspbian/bandwidth.j2 | + | # https:// |
- | dest: /usr/local/src/ | + | |
- | when: ( raspberry_oled == " | + | src: templates/interfaces_mesh_mit_client.j2 |
+ | dest: /etc/network/interfaces | ||
+ | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length > 0 ) | ||
+ | </ | ||
- | - name: Startscript für das OLED anlegen | + | == Templates == |
- | template: | + | <file java ~/ansible/roles/client-mesh/templates/interfaces_client_ohne_mesh.j2># interfaces(5) file used by ifup(8) and ifdown(8) |
- | src: Raspbian/oled-bandwidth.j2 | + | |
- | dest: /etc/systemd/system/oled-bandwidth.service | + | |
- | when: ( raspberry_oled == " | + | |
- | - name: Service oled-bandwidth beim Booten starten | + | # Please note that this file is written to be used with dhcpcd |
- | | + | # For static IP, consult / |
- | name: oled-bandwidth | + | |
- | daemon_reload: | + | |
- | state: started | + | |
- | enabled: yes | + | |
- | when: ( raspberry_oled == " | + | |
- | - name: Reboot nach Abschluss der Konfiguration unseres Offloaders | + | # Include files from / |
- | | + | # source-directory / |
+ | |||
+ | auto eth0 | ||
+ | iface eth0 inet dhcp | ||
+ | |||
+ | auto eth0.{{ raspberry_clientvlan }} | ||
+ | iface eth0.{{ raspberry_clientvlan }} inet manual | ||
- | ... #YAML Ende Syntax</ | + | auto br-{{ ffmuc_segment }} |
+ | iface br-{{ ffmuc_segment }} inet dhcp | ||
+ | bridge-ports bat-{{ ffmuc_segment }} eth0.{{ raspberry_clientvlan }} | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | ||
+ | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | |||
+ | # Please note that this file is written to be used with dhcpcd | ||
+ | # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' | ||
+ | |||
+ | # Include files from / | ||
+ | # source-directory / | ||
+ | |||
+ | auto eth0 | ||
+ | iface eth0 inet dhcp | ||
+ | |||
+ | auto eth0.{{ raspberry_meshvlan }} | ||
+ | iface eth0.{{ raspberry_meshvlan }} inet manual | ||
+ | pre-up /sbin/ip link add vxlan-mesh type vxlan id {{ ffmuc_vxlan_id }} group ff02::15c dstport 4789 port 32768 61000 no udpcsum udp6zerocsumtx udp6zerocsumrx dev eth0.{{ raspberry_meshvlan }} || true | ||
+ | up /sbin/ip link set vxlan-mesh up | ||
+ | post-up / | ||
+ | post-up / | ||
+ | down ip link set vxlan-mesh down | ||
+ | post-down ip link del vxlan-mesh || true | ||
+ | |||
+ | auto eth0.{{ raspberry_clientvlan }} | ||
+ | iface eth0.{{ raspberry_clientvlan }} inet manual | ||
+ | |||
+ | auto br-{{ ffmuc_segment }} | ||
+ | iface br-{{ ffmuc_segment }} inet dhcp | ||
+ | bridge-ports bat-{{ ffmuc_segment }} eth0.{{ raspberry_clientvlan }} | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | ||
+ | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | |||
+ | # Please note that this file is written to be used with dhcpcd | ||
+ | # For static IP, consult / | ||
+ | |||
+ | # Include files from / | ||
+ | # source-directory / | ||
+ | |||
+ | auto eth0 | ||
+ | iface eth0 inet dhcp | ||
+ | |||
+ | auto eth0.{{ raspberry_meshvlan }} | ||
+ | iface eth0.{{ raspberry_meshvlan }} inet manual | ||
+ | pre-up /sbin/ip link add vxlan-mesh type vxlan id {{ ffmuc_vxlan_id }} group ff02::15c dstport 4789 port 32768 61000 no udpcsum udp6zerocsumtx udp6zerocsumrx dev eth0.{{ raspberry_meshvlan }} || true | ||
+ | up /sbin/ip link set vxlan-mesh up | ||
+ | post-up / | ||
+ | post-up / | ||
+ | down ip link set vxlan-mesh down | ||
+ | post-down ip link del vxlan-mesh || true | ||
+ | |||
+ | auto br-{{ ffmuc_segment }} | ||
+ | iface br-{{ ffmuc_segment }} inet dhcp | ||
+ | bridge-ports bat-{{ ffmuc_segment }} | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | ||
+ | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | ||
+ | pre-up / | ||
+ | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | ||
+ | </ | ||
+ | |||
+ | <file bash ~/ | ||
+ | # | ||
+ | # rc.local | ||
+ | # | ||
+ | # This script is executed at the end of each multiuser runlevel. | ||
+ | # Make sure that the script will "exit 0" on success or any other | ||
+ | # value on error. | ||
+ | # | ||
+ | # In order to enable or disable this script just change the execution | ||
+ | # bits. | ||
+ | # | ||
+ | # By default this script does nothing. | ||
+ | |||
+ | # Print the IP address | ||
+ | _IP=$(hostname -I) || true | ||
+ | if [ " | ||
+ | printf "My IP address is %s\n" " | ||
+ | fi | ||
+ | sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | ||
+ | / | ||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | <file bash ~/ | ||
+ | # | ||
+ | # rc.local | ||
+ | # | ||
+ | # This script is executed at the end of each multiuser runlevel. | ||
+ | # Make sure that the script will "exit 0" on success or any other | ||
+ | # value on error. | ||
+ | # | ||
+ | # In order to enable or disable this script just change the execution | ||
+ | # bits. | ||
+ | # | ||
+ | # By default this script does nothing. | ||
+ | |||
+ | # Print the IP address | ||
+ | _IP=$(hostname -I) || true | ||
+ | if [ " | ||
+ | printf "My IP address is %s\n" " | ||
+ | fi | ||
+ | / | ||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | |||
+ | === Rolle " | ||
+ | == Tasks == | ||
+ | <file java ~/ | ||
+ | - include: i2c-bcm2708.yml | ||
+ | - include: i2c-dev.yml | ||
+ | - include: packages.yml | ||
+ | - include: i2c_arm.yml | ||
+ | - include: reboot.yml | ||
+ | - include: adafruitclone.yml | ||
+ | - include: adafruitconfig.yml | ||
+ | - include: scriptclone.yml | ||
+ | - include: scriptconfig.yml | ||
+ | - include: scriptstart.yml | ||
+ | - include: scriptstartup.yml | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: "Repo Adafruit_Python_SSD1306 klonen" | ||
+ | # https:// | ||
+ | git: | ||
+ | repo: https:// | ||
+ | dest: / | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: "Für OLED-Konfiguration Adafruit_Python_SSD1306 installieren" | ||
+ | # https:// | ||
+ | shell: cd / | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: "Laden des Kernelmodul i2c_arm beim Booten veranlassen" | ||
+ | # https:// | ||
+ | template: | ||
+ | src: templates/ | ||
+ | dest: / | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: "Für OLED-Konfiguration i2c-bcm2708 in / | ||
+ | # https:// | ||
+ | shell: echo i2c-bcm2708 >> / | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: "Für OLED-Konfiguration i2c-dev in / | ||
+ | # https:// | ||
+ | shell: echo i2c-dev >> / | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: " | ||
+ | # https:// | ||
+ | apt: | ||
+ | update_cache: | ||
+ | pkg: | ||
+ | - python3-dev | ||
+ | - python3-smbus | ||
+ | - i2c-tools | ||
+ | - python3-pil | ||
+ | - python3-pip | ||
+ | - python3-setuptools | ||
+ | - python3-rpi.gpio | ||
+ | - git | ||
+ | - fonts-freefont-ttf | ||
+ | state: present | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: " | ||
+ | # https:// | ||
+ | reboot: | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: " | ||
+ | # https:// | ||
+ | git: | ||
+ | repo: https:// | ||
+ | dest: / | ||
+ | force: yes | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: " | ||
+ | # https:// | ||
+ | template: | ||
+ | src: templates/ | ||
+ | dest: / | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: " | ||
+ | # https:// | ||
+ | template: | ||
+ | src: templates/ | ||
+ | dest: / | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
+ | |||
+ | <file java ~/ | ||
+ | - name: " | ||
+ | # https:// | ||
+ | systemd: | ||
+ | name: oled-bandwidth | ||
+ | daemon_reload: | ||
+ | state: started | ||
+ | enabled: yes | ||
+ | when: ( raspberry_oled == " | ||
+ | </ | ||
- | === bandwith.j2 === | + | == Templates |
- | < | + | < |
- | # Inspired by https:// | + | |
# | # | ||
# Maintained by awlnx - aw@awlnx.space | # Maintained by awlnx - aw@awlnx.space | ||
Zeile 948: | Zeile 2086: | ||
# Adjust to your needs | # Adjust to your needs | ||
wifi = ' | wifi = ' | ||
- | vpn = 'fastd-{{ ffmuc_segment }}' | + | vpn = 'mesh-vpn' |
batman = ' | batman = ' | ||
primary_mac = '{{ ansible_eth0.macaddress }}' | primary_mac = '{{ ansible_eth0.macaddress }}' | ||
Zeile 961: | Zeile 2099: | ||
# Raspberry Pi pin configuration: | # Raspberry Pi pin configuration: | ||
- | RST = 24 | + | RST = ' |
# 128x64 display with hardware I2C: | # 128x64 display with hardware I2C: | ||
Zeile 1146: | Zeile 2284: | ||
# Batman Clients | # Batman Clients | ||
- | clients = subprocess.check_output(" | + | clients = subprocess.check_output(" |
draw.text((0, | draw.text((0, | ||
draw.text((10, | draw.text((10, | ||
Zeile 1160: | Zeile 2298: | ||
disp.image(image) | disp.image(image) | ||
- | disp.display()</ | + | disp.display() |
- | + | </ | |
- | + | ||
- | === batman-adv.module.j2 === | + | |
- | <file java batman-adv.module.j2># | + | |
- | # Load batman-adv module on system boot | + | |
- | # | + | |
- | batman-adv | + | |
- | dummy</ | + | |
- | === config.j2 === | + | < |
- | < | + | |
# http:// | # http:// | ||
# Some settings may impact device functionality. See link above for details | # Some settings may impact device functionality. See link above for details | ||
Zeile 1236: | Zeile 2366: | ||
[all] | [all] | ||
- | # | + | # |
- | === dkms.j2 === | + | |
- | <file j2 dkms.j2> | + | |
- | PACKAGE_VERSION={{ batman_adv_version }} | + | |
- | + | ||
- | DEST_MODULE_LOCATION=/ | + | |
- | BUILT_MODULE_NAME=batman-adv | + | |
- | BUILT_MODULE_LOCATION=net/ | + | |
- | + | ||
- | MAKE="' | + | |
- | CLEAN="' | + | |
- | + | ||
- | AUTOINSTALL=" | + | |
- | [django@T410 Raspbian]$ | + | |
- | [django@T410 Raspbian]$ | + | |
- | [django@T410 Raspbian]$ | + | |
- | [django@T410 Raspbian]$ | + | |
- | [django@T410 Raspbian]$ cat dkms.j2 | + | |
- | PACKAGE_NAME=batman-adv | + | |
- | PACKAGE_VERSION={{ batman_adv_version }} | + | |
- | + | ||
- | DEST_MODULE_LOCATION=/ | + | |
- | BUILT_MODULE_NAME=batman-adv | + | |
- | BUILT_MODULE_LOCATION=net/ | + | |
- | + | ||
- | MAKE="' | + | |
- | CLEAN="' | + | |
- | + | ||
- | AUTOINSTALL=" | + | |
- | + | ||
- | === ext-respondd_alias.json.j2 === | + | |
- | <file j2 ext-respondd_alias.json.j2> | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | } | + | |
- | }, | + | |
- | " | + | |
- | }</ | + | |
- | + | ||
- | === ext-respondd_config.json.j2 === | + | |
- | <file j2 ext-respondd_config.json.j2> | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | }</ | + | |
- | + | ||
- | === fastd.j2 === | + | |
- | <file j2 fastd.j2># | + | |
- | # welt FASTd configuration | + | |
- | # | + | |
- | + | ||
- | log to syslog level info; | + | |
- | + | ||
- | interface " | + | |
- | + | ||
- | method " | + | |
- | method " | + | |
- | + | ||
- | secret "{{ secretkey_var.stdout }}"; | + | |
- | + | ||
- | mtu 1406; | + | |
- | + | ||
- | status socket "/ | + | |
- | + | ||
- | on up " | + | |
- | batctl ra BATMAN_V | + | |
- | ip link set $INTERFACE down | + | |
- | ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | ip link set $INTERFACE up | + | |
- | batctl -m bat-{{ ffmuc_segment }} if add $INTERFACE | + | |
- | + | ||
- | "; | + | |
- | + | ||
- | on down " | + | |
- | batctl -m bat-{{ ffmuc_segment }} if del $INTERFACE | + | |
- | "; | + | |
- | peer group " | + | |
- | peer limit 1; | + | |
- | + | ||
- | peer " | + | |
- | key " | + | |
- | remote " | + | |
- | } | + | |
- | + | ||
- | peer " | + | |
- | key " | + | |
- | remote " | + | |
- | } | + | |
- | + | ||
- | peer " | + | |
- | key " | + | |
- | remote " | + | |
- | } | + | |
- | }</ | + | |
- | + | ||
- | === hostapd.j2 === | + | |
- | <file j2 hostapd.j2> | + | |
- | + | ||
- | country_code=US | + | |
- | + | ||
- | interface=wlan0 | + | |
- | driver=nl80211 | + | |
- | + | ||
- | macaddr_acl=0 | + | |
- | + | ||
- | logger_syslog=0 | + | |
- | logger_syslog_level=4 | + | |
- | logger_stdout=-1 | + | |
- | logger_stdout_level=0 | + | |
- | + | ||
- | hw_mode=a | + | |
- | wmm_enabled=1 | + | |
- | + | ||
- | # N | + | |
- | ieee80211n=1 | + | |
- | require_ht=1 | + | |
- | ht_capab=[MAX-AMSDU-3839][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40] | + | |
- | + | ||
- | # AC | + | |
- | ieee80211ac=1 | + | |
- | require_vht=1 | + | |
- | ieee80211d=0 | + | |
- | ieee80211h=0 | + | |
- | vht_capab=[MAX-AMSDU-3839][SHORT-GI-80] | + | |
- | vht_oper_chwidth=1 | + | |
- | channel=36 | + | |
- | vht_oper_centr_freq_seg0_idx=42</ | + | |
- | + | ||
- | === hosts.j2 === | + | |
- | <file j2 hosts.j2> | + | |
- | :: | + | |
- | ff02:: | + | |
- | ff02:: | + | |
- | + | ||
- | === interfaces_client_ohne_mesh.j2 === | + | |
- | <file j2 interfaces_client_ohne_mesh.j2># | + | |
- | + | ||
- | # Please note that this file is written to be used with dhcpcd | + | |
- | # For static IP, consult / | + | |
- | + | ||
- | # Include files from / | + | |
- | # source-directory / | + | |
- | + | ||
- | auto eth0 | + | |
- | iface eth0 inet dhcp | + | |
- | + | ||
- | auto eth0.{{ raspberry_clientvlan }} | + | |
- | iface eth0.{{ raspberry_clientvlan }} inet manual | + | |
- | + | ||
- | auto br-{{ ffmuc_segment }} | + | |
- | iface br-{{ ffmuc_segment }} inet dhcp | + | |
- | bridge-ports bat-{{ ffmuc_segment }} eth0.{{ raspberry_clientvlan }} | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | + | |
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | + | ||
- | === interfaces.j2 === | + | |
- | <file j2 interfaces.j2># | + | |
- | + | ||
- | # Please note that this file is written to be used with dhcpcd | + | |
- | # For static IP, consult / | + | |
- | + | ||
- | # Include files from / | + | |
- | # source-directory / | + | |
- | + | ||
- | auto eth0 | + | |
- | iface eth0 inet dhcp | + | |
- | + | ||
- | auto br-{{ ffmuc_segment }} | + | |
- | iface br-{{ ffmuc_segment }} inet dhcp | + | |
- | bridge-ports bat-{{ ffmuc_segment }} | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | + | |
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
</ | </ | ||
- | === interfaces_mesh_mit_client.j2 === | + | < |
- | < | + | |
- | + | ||
- | # Please note that this file is written to be used with dhcpcd | + | |
- | # For static IP, consult | + | |
- | + | ||
- | # Include files from /etc/network/interfaces.d: | + | |
- | # source-directory / | + | |
- | + | ||
- | auto eth0 | + | |
- | iface eth0 inet dhcp | + | |
- | + | ||
- | auto eth0.{{ raspberry_meshvlan }} | + | |
- | iface eth0.{{ raspberry_meshvlan }} inet manual | + | |
- | pre-up /sbin/ip link add vxlan-mesh type vxlan id {{ ffmuc_vxlan_id }} group ff02::15c dstport 4789 port 32768 61000 no udpcsum udp6zerocsumtx udp6zerocsumrx dev eth0.{{ raspberry_meshvlan }} || true | + | |
- | up /sbin/ip link set vxlan-mesh up | + | |
- | post-up / | + | |
- | post-up / | + | |
- | down ip link set vxlan-mesh down | + | |
- | post-down ip link del vxlan-mesh || true | + | |
- | + | ||
- | auto eth0.{{ raspberry_clientvlan }} | + | |
- | iface eth0.{{ raspberry_clientvlan }} inet manual | + | |
- | + | ||
- | auto br-{{ ffmuc_segment }} | + | |
- | iface br-{{ ffmuc_segment }} inet dhcp | + | |
- | bridge-ports bat-{{ ffmuc_segment }} eth0.{{ raspberry_clientvlan }} | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | + | |
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | </ | + | |
- | + | ||
- | === interfaces_mesh_ohne_client.j2 === | + | |
- | <file j2 interfaces_mesh_ohne_client.j2># | + | |
- | + | ||
- | # Please note that this file is written to be used with dhcpcd | + | |
- | # For static IP, consult / | + | |
- | + | ||
- | # Include files from / | + | |
- | # source-directory / | + | |
- | + | ||
- | auto eth0 | + | |
- | iface eth0 inet dhcp | + | |
- | + | ||
- | auto eth0.{{ raspberry_meshvlan }} | + | |
- | iface eth0.{{ raspberry_meshvlan }} inet manual | + | |
- | pre-up /sbin/ip link add vxlan-mesh type vxlan id {{ ffmuc_vxlan_id }} group ff02::15c dstport 4789 port 32768 61000 no udpcsum udp6zerocsumtx udp6zerocsumrx dev eth0.{{ raspberry_meshvlan }} || true | + | |
- | up /sbin/ip link set vxlan-mesh up | + | |
- | post-up / | + | |
- | post-up / | + | |
- | down ip link set vxlan-mesh down | + | |
- | post-down ip link del vxlan-mesh || true | + | |
- | + | ||
- | auto br-{{ ffmuc_segment }} | + | |
- | iface br-{{ ffmuc_segment }} inet dhcp | + | |
- | bridge-ports bat-{{ ffmuc_segment }} | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link add dummy-{{ ffmuc_segment }} type dummy | + | |
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | pre-up /sbin/ip link set dummy-{{ ffmuc_segment }} up | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link set bat-{{ ffmuc_segment }} up | + | |
- | pre-up / | + | |
- | pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | + | |
- | </ | + | |
- | === oled-bandwidth.j2 === | + | |
- | <file bash oled-bandwidth.j2># | + | |
[Unit] | [Unit] | ||
+ | # see man systemd.unit | ||
+ | Description=Starting OLED-Trafic output | ||
+ | Documentation=https:// | ||
After=network.target | After=network.target | ||
[Service] | [Service] | ||
+ | # see man systemd.service, | ||
ExecStart=/ | ExecStart=/ | ||
+ | StandardOutput=syslog | ||
+ | StandardError=syslog | ||
[Install] | [Install] | ||
- | WantedBy=default.target</ | + | WantedBy=default.target |
+ | </ | ||
- | === rclocal_both.j2 === | ||
- | <file java rclocal_both.j2># | ||
- | # | ||
- | # rc.local | ||
- | # | ||
- | # This script is executed at the end of each multiuser runlevel. | ||
- | # Make sure that the script will "exit 0" on success or any other | ||
- | # value on error. | ||
- | # | ||
- | # In order to enable or disable this script just change the execution | ||
- | # bits. | ||
- | # | ||
- | # By default this script does nothing. | ||
- | # Print the IP address | + | === Rolle "final" |
- | _IP=$(hostname -I) || true | + | == Tasks == |
- | if [ "$_IP" | + | <file java ~/ansible/roles/final/tasks/main.yml> |
- | | + | - include: reboot.yml |
- | fi | + | ... #YAML Ende Syntax |
- | sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | + | </ |
- | echo 1000000 > /sys/devices/virtual/ | + | |
- | exit 0</ | + | |
- | === rclocal_vxlan.j2 === | + | <file java ~/ |
- | <file java rclocal_vxlan.j2># | + | - name: "Reboot nach Abschluss der Konfiguration unseres Offloaders" |
- | # | + | # https:// |
- | # rc.local | + | |
- | # | + | </ |
- | # This script is executed at the end of each multiuser runlevel. | + | |
- | # Make sure that the script will "exit 0" | + | |
- | # value on error. | + | |
- | # | + | |
- | # In order to enable or disable this script just change the execution | + | |
- | # bits. | + | |
- | # | + | |
- | # By default this script does nothing. | + | |
- | # Print the IP address | + | ==== Download des auf Debian Buster basierenden Raspbian ==== |
- | _IP=$(hostname -I) || true | + | |
- | if [ " | + | |
- | printf "My IP address is %s\n" " | + | |
- | fi | + | |
- | echo 1000000 > / | + | |
- | exit 0</ | + | |
- | === rclocal_wifi.j2 === | + | Nachdem es aktuell((Stand: |
- | <file java rclocal_both.j2># | + | |
- | # | + | |
- | # rc.local | + | |
- | # | + | |
- | # This script is executed at the end of each multiuser runlevel. | + | |
- | # Make sure that the script will "exit 0" on success or any other | + | |
- | # value on error. | + | |
- | # | + | |
- | # In order to enable or disable this script just change the execution | + | |
- | # bits. | + | |
- | # | + | |
- | # By default this script does nothing. | + | |
- | + | ||
- | # Print the IP address | + | |
- | _IP=$(hostname -I) || true | + | |
- | if [ " | + | |
- | printf "My IP address is %s\n" " | + | |
- | fi | + | |
- | sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | + | |
- | echo 1000000 > / | + | |
- | exit 0</ | + | |
- | + | ||
- | ==== Download des auf Debian Buster basierenden Raspbian ==== | + | |
- | Nachdem es aktuell((Stand: | + | |
Eine Anleitung zur manuellen Installation findet man auf der **[[https:// | Eine Anleitung zur manuellen Installation findet man auf der **[[https:// | ||
- | $ wget https:// | + | $ wget https://downloads.raspberrypi.org/ |
- | Bevor wir nun das Archiv entpacken überprüfen wir noch die Integrität der heruntergeladenen Datei. | + | Bevor wir nun das Archiv entpacken überprüfen wir noch die Integrität der heruntergeladenen Datei. |
- | $ sha256sum | + | $ sha256sum |
+ | |||
+ | 2022-01-28-raspios-bullseye-arm64-lite.zip: | ||
- | | + | Da der SHA256-Prüfsummencheck positiv erfolgreich war und mit einem **OK** bestätigt wurde, können wir nun das Archiv entpacken. |
+ | | ||
- | Die Zeichenfolge überprüfen wir nun mit den Angaben auf der Seite: https://www.raspberrypi.org/ | + | < |
- | {{ :centos: | + | |
- | Da sich beide SHA-Werte **__nicht__** unterscheiden können wir das herunter geladene ZIP-Archiv nun entpacken. | ||
- | $ unzip raspbian_lite_latest | ||
- | |||
- | < | ||
- | inflating: 2020-02-13-raspbian-buster-lite.img | ||
- | </ | ||
==== Kopieren des Raspbian Images auf die microSD-Karte ==== | ==== Kopieren des Raspbian Images auf die microSD-Karte ==== | ||
Nun können wir das Image auf die MicroSD Karte, die wir später in den Raspberry 4B stecken kopieren. Wir werfen also am besten einmal einen Blick in das syslog unseres Arbeitsrechners und erkennen so das Device unserer Speicherkarte. | Nun können wir das Image auf die MicroSD Karte, die wir später in den Raspberry 4B stecken kopieren. Wir werfen also am besten einmal einen Blick in das syslog unseres Arbeitsrechners und erkennen so das Device unserer Speicherkarte. | ||
- | # tail -f / | + | < |
- | < | + | < |
- | Feb 16 21:47:29 T410 kernel: | + | Sep 5 21:10:57 Djangos-ThinkPad-X230 |
- | Feb 16 21:47:29 T410 kernel: | + | Sep 5 21:10:57 Djangos-ThinkPad-X230 |
- | Feb 16 21:47:29 T410 kernel: usb-storage 1-1.2:1.0: USB Mass Storage device detected | + | Sep 5 21:10:58 Djangos-ThinkPad-X230 kernel: [12796.199093] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. |
- | Feb 16 21:47:29 T410 kernel: scsi host4: usb-storage 1-1.2:1.0 | + | Sep 5 21:10:58 Djangos-ThinkPad-X230 systemd[1]: Finished Clean the /media/django/boot mount point. |
- | Feb 16 21:47:29 T410 mtp-probe[38884]: checking bus 1, device 6: "/sys/devices/pci0000: | + | Sep 5 21:10:58 Djangos-ThinkPad-X230 udisksd[976]: Mounted |
- | Feb 16 21:47:29 T410 mtp-probe[38884]: | + | Sep 5 21:10:58 Djangos-ThinkPad-X230 kernel: [12796.302402] EXT4-fs (mmcblk0p2): recovery complete |
- | Feb 16 21:47:29 T410 mtp-probe[38887]: checking bus 1, device 6: "/sys/devices/pci0000:00/0000: | + | Sep 5 21:10:58 Djangos-ThinkPad-X230 |
- | Feb 16 21:47:29 T410 mtp-probe[38887]: | + | Sep 5 21:10:58 Djangos-ThinkPad-X230 systemd[1]: Finished Clean the / |
- | Feb 16 21:47:30 T410 kernel: scsi 4:0:0:0: Direct-Access | + | Sep 5 21:10:58 Djangos-ThinkPad-X230 udisksd[976]: Mounted /dev/mmcblk0p2 |
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: Attached scsi generic sg2 type 0 | + | Sep 5 21:11:09 Djangos-ThinkPad-X230 gnome-terminal-[8119]: |
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB) | + | |
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] Write Protect is off | + | |
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] No Caching mode page found | + | |
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through | + | |
- | Feb 16 21:47:30 T410 kernel: sdb: sdb1 sdb2 < sdb5 > | + | |
- | Feb 16 21:47:30 T410 kernel: sd 4:0:0:0: [sdb] Attached SCSI removable disk | + | |
- | Feb 16 21:47:31 T410 kernel: | + | |
- | Feb 16 21:47:31 T410 kernel: EXT4-fs (sdb5): mounted filesystem with ordered data mode. Opts: (null) | + | |
- | Feb 16 21:47:31 T410 kernel: ext4 filesystem being mounted at /run/ | + | |
- | Feb 16 21:47:31 T410 journal[1042]: Mounted /dev/sdb5 at /run/ | + | |
- | In dem gezeigtem Fall handelt es sich also um die Gerätedatei **''/ | + | In dem gezeigtem Fall handelt es sich also um die Gerätedatei **''/ |
- | # dd if=~/2020-02-13-raspbian-buster-lite.img of=/dev/sdb bs=4M status=progress conv=fsync | + | < |
+ | < | ||
+ | < | ||
- | Da wir später weder Tastatur noch Monitor an unseren Raspberry 4B anstecken wollen, diesen demnach im **headless**-Mode betreiben wollen und werden, legen wir noch eine Datei **''/ | + | Da wir später weder Tastatur noch Monitor an unseren Raspberry 4B anstecken wollen, diesen demnach im **headless**-Mode betreiben wollen und werden, legen wir noch eine Datei **''/ |
- | | + | < |
- | Anschließend könne | + | Anschliessend können |
==== Ändern des Default-Passwortes und kopieren des SSH-Public-Keys auf den Raspberry 4 ==== | ==== Ändern des Default-Passwortes und kopieren des SSH-Public-Keys auf den Raspberry 4 ==== | ||
+ | |||
<WRAP center round important 80%> | <WRAP center round important 80%> | ||
Der Benutzername lautet **'' | Der Benutzername lautet **'' | ||
Zeile 1657: | Zeile 2457: | ||
| | ||
- | Alternativ dazu müssten wir den Raspberry 4B über die IP-Adresse ansprechen, die dieser zugewiesen bekommt. In dem folgenden Beispiel wäre das die IP-Adresse: **10.0.10.29**: | + | Alternativ dazu müssten wir den Raspberry 4B über die IP-Adresse ansprechen, die dieser zugewiesen bekommt. In dem folgenden Beispiel wäre das die IP-Adresse: **192.168.0.25**: |
- | $ ssh -l pi 10.0.10.29 -o IdentitiesOnly=yes " | + | $ ssh -l pi 192.168.0.25 -o IdentitiesOnly=yes " |
- | | + | |
In dem folgenden Konfigurationsbeispiel vergeben wir für den Benutzer **'' | In dem folgenden Konfigurationsbeispiel vergeben wir für den Benutzer **'' | ||
- | + | < | |
- | + | ECDSA key fingerprint is SHA256:vXhdvud24tyTUtOan4XeTZ7GzxZDQn9Rj0mxuhimkH4. | |
- | + | ||
- | + | ||
- | < | + | |
- | ECDSA key fingerprint is SHA256:scR7cgECzebzn7GYSLvXueECAxeGm7l7Rp0fp4DHaUk. | + | |
Are you sure you want to continue connecting (yes/ | Are you sure you want to continue connecting (yes/ | ||
- | Warning: Permanently added 'raspberry-ansible' (ECDSA) to the list of known hosts. | + | Warning: Permanently added '10.0.10.29' (ECDSA) to the list of known hosts. |
- | pi@raspberry-ansible's password: | + | pi@10.0.10.29's password: |
Current password: raspberry | Current password: raspberry | ||
New password: gECzebzn7GYSLvXueECAxeGm7l7 | New password: gECzebzn7GYSLvXueECAxeGm7l7 | ||
Zeile 1677: | Zeile 2473: | ||
passwd: password updated successfully | passwd: password updated successfully | ||
Changing password for pi. | Changing password for pi. | ||
- | + | / | |
- | / | + | |
/ | / | ||
/ | / | ||
- | pi@raspberry-ansible's password: | + | pi@10.0.10.29's password: |
Number of key(s) added: 1 | Number of key(s) added: 1 | ||
Zeile 1688: | Zeile 2483: | ||
and check to make sure that only the key(s) you wanted were added. | and check to make sure that only the key(s) you wanted were added. | ||
</ | </ | ||
- | |||
- | |||
- | |||
$ ssh raspberry-ansible | $ ssh raspberry-ansible | ||
< | < | ||
- | <font style=" | + | <font style=" |
The programs included with the Debian GNU/Linux system are free software; | The programs included with the Debian GNU/Linux system are free software; | ||
the exact distribution terms for each program are described in the | the exact distribution terms for each program are described in the | ||
- | individual files in / | + | individual files in / |
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | ||
Zeile 1713: | Zeile 2505: | ||
==== Starten des Ansible-Playbooks ==== | ==== Starten des Ansible-Playbooks ==== | ||
Beim Abarbeiten des ansible-playbook werden zur Konfiguration des Offloaders und dessen Komponenten/ | Beim Abarbeiten des ansible-playbook werden zur Konfiguration des Offloaders und dessen Komponenten/ | ||
- | * Batman-Relase | + | * Batman-Release |
* [[https:// | * [[https:// | ||
* Angaben zur [[https:// | * Angaben zur [[https:// | ||
Zeile 1726: | Zeile 2518: | ||
* Ist an dem Raspberry ein OLE-Display von [[https:// | * Ist an dem Raspberry ein OLE-Display von [[https:// | ||
- | Bei der Ausführung sind seit Version | + | === wireguard-offloader.yml === |
- | - **raspi_offloader_menu.yml** \\ Hier werden die benötigten Parameter bei der Ausführung des ansible-playbooks interaktiv abgefragt. Somit ist eine Änderung/ | + | In dem tar.gz-Archiv des Playbooks ist seit Version |
- | - **raspi_offloader_file.yml** | + | |
- | | + | Hier werden die zur Konfiguration benötigten Parameter nicht beim Aufruf des Playbooks abgefragt, sondern |
- | | + | |
- | | + | In den Zeilen **'' |
- | | + | $ vim ~/ |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | === Bsp. 1 : raspi_offloader_menu.yml === | + | < |
- | Am besten besorgen wir uns die entsprechenden Daten vorab und halten diese parat, da diese nach dem Start des ansible-playbooks abgefragt werden. | + | 55 |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | Haben wir die Informationen | + | === Playbook Lauf === |
- | $ ansible-playbook ~/ansible/playbooks/ | + | Nachdem |
+ | $ ansible-playbook ~/ansible/wireguard-offloader.yml | ||
< | < | ||
<font style=" | <font style=" | ||
- | Was ist die aktuelle BATMAN Version, die hier | + | PLAY [raspi_offloader.yml] ********************************************************************************************************************************* |
- | https:// | + | |
- | In welchem der Segmente hier soll der Offloader betrieben werden: | + | TASK [Gathering Facts] ************************************************************************************************************************************* |
- | muc_cty | + | <font style=" |
- | muc_nord | + | |
- | muc_ost | + | |
- | muc_sued | + | |
- | muc_west | + | |
- | uml_nord | + | |
- | uml_ost | + | |
- | uml_sued | + | |
- | uml_west | + | |
- | gauting | + | |
- | freising | + | |
- | welt : welt | + | |
- | Wie lautet der Hostname | + | TASK [basic : Hostname |
+ | <font style=" | ||
- | Wie lautet die Kontakt-Adresse des Node-Betreibers? | + | TASK [basic |
+ | <font style=" | ||
- | Wie lautet der Geographische Breitengrad | + | TASK [basic : Beschreibung |
+ | <font style=" | ||
- | Wie lautet der Geographische Längengrad des Raspberry | + | TASK [basic : Service rfkill am Raspberry |
+ | <font style=" | ||
- | Soll der Raspberry Offloader auch ein WLAN ausstrahlen, ' | + | TASK [basic : Update und Upgrade |
+ | <font style=" | ||
+ | <font style=" | ||
- | Soll der Raspberry Offloader ein Client-VLAN zur Verfügung stellen? | + | TASK [basic : Reboot nach update] ************************************************************************************************************************** |
- | Wenn ja, wie lautet die VLAN-ID? | + | <font style=" |
- | Soll der Raspberry Offloader ein Mesh-VLAN zur Verfügung stellen? | + | TASK [batman : *BATMAN Installation* : Download des aktuellen BATMAN Archives] ***************************************************************************** |
- | Wenn ja, wie lautet die VLAN-ID? | + | <font style=" |
- | Ist ein OLE-Display an dem Raspberry Offloader angeschlossen? | + | TASK [batman : *BATMAN Installation* : Entpacken des BATMAN-Archives] ************************************************************************************** |
+ | <font style=" | ||
- | PLAY [raspi_offloader.yml] ************************************************************************************************************* | + | TASK [batman : *BATMAN compile* : Installation des Dynamic Kernel Module Support Framework und der Header Files für den Raspberry Pi OS Linux Kernel] |
+ | <font style=" | ||
- | TASK [Gathering Facts] ***************************************************************************************************************** | + | TASK [batman |
- | <font style=" | + | <font style=" |
- | + | ||
- | TASK [Hostname ändern] | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Anpassung /etc/hosts] ************************************************************************************************************ | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Beschreibung des User ' | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Service rfkill am Raspberry deaktivieren] **************************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Update und Upgrade der APT-Pakete] *********************************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | <font style=" | + | |
- | + | ||
- | TASK [Reboot nach update] ************************************************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Download des aktuellen | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [BATMAN-Archiv entpacken] ********************************************************************************************************* | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Installation des Dynamic Kernel Module Support Framework und der Header Files für den Raspberry Pi Linux Kernel] ***************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Rebuild BATMAN Kernel Header Dateien] ******************************************************************************************** | + | |
- | + | ||
- | <font style=" | + | |
<font style=" | <font style=" | ||
- | TASK [Anlegen der dkms.conf für Dynamic Kernel Module Support] | + | TASK [batman : *BATMAN compile* : Anlegen der dkms.conf für Dynamic Kernel Module Support] ***************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Dynamic Kernel Module Support hinzufügen] | + | TASK [batman : *BATMAN compile* : Dynamic Kernel Module Support hinzufügen] ******************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Dynamic Kernel Module | + | TASK [batman : *BATMAN compile* : Dynamic Kernel Module bauen] ********************************************************************************************* |
- | <font style=" | + | <font style=" |
- | TASK [Dynamic Kernel Module | + | TASK [batman : *BATMAN compile* : BATMAN |
- | <font style=" | + | <font style=" |
- | TASK [Laden | + | TASK [batman : *BATMAN load-modules* : Laden der BATMAN Dynamic Kernel Module |
- | <font style=" | + | <font style=" |
- | TASK [Laden des BATMAN | + | TASK [batman : *BATMAN |
- | <font style=" | + | <font style=" |
- | TASK [Laden des dummy Moduls] ********************************************************************************************************** | + | TASK [batman : *BATMAN load-modules* : BATMAN-ADV Modul laden] |
- | <font style=" | + | <font style=" |
- | TASK [Installation der bridge-utils] ************************************************************************************************** | + | TASK [batman : *buster-backport* : PGP-Schlüssel 04EE7237B7D453EC für buster-backports installieren] ******************************************************* |
- | <font style=" | + | <font style=" |
- | TASK [Aktivierung von BATMAN_V] ******************************************************************************************************** | + | TASK [batman : *buster-backport* : PGP-Schlüssel 648ACFD622F3D138 für buster-backports installieren] |
- | <font style=" | + | <font style=" |
- | TASK [Konfiguration des Interfaces] **************************************************************************************************** | + | TASK [batman : *buster-backport* : buster-backports dem System bekannt machen] |
- | <font style=" | + | <font style=" |
- | TASK [Installation von FASTD] ********************************************************************************************************** | + | TASK [batman : *buster-backport* : APT-Cache aktualisieren] |
- | <font style=" | + | <font style=" |
- | TASK [Verzeichnis für fastd- Konfigurationsdatei anlegen] ****************************************************************************** | + | TASK [batman : *utils-installation* : Installation der bridge-utils] *************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Schlüssel für fastd erstellen] *************************************************************************************************** | + | TASK [batman : *utils-installation* : Installation der bridge-utils] |
- | <font style=" | + | <font style=" |
- | TASK [FASTD Secret Key aus / | + | TASK [batman : *BATMAN-ADV* : Aktivierung von BATMAN_V] **************************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [FASTD Socket ermitteln] ********************************************************************************************************** | + | TASK [batman : *BATMAN-ADV Interfaces* : Konfiguration des Interfaces] |
- | <font style=" | + | <font style=" |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | <font style=" | + | |
- | TASK [Erstellen | + | TASK [batman : *BATMAN Installation* : Reboot nach Ende der BATMAN Installationsschritte] ****************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Service fastd beim Booten starten] *********************************************************************************************** | + | TASK [wireguard : *wireguard* : Installation von wireguard] ************************************************************************************************ |
- | <font style=" | + | <font style=" |
- | TASK [Installation der Pakete git und python3-netifaces] ******************************************************************************* | + | TASK [wireguard : *wireguard* : Schlüsselmaterial erstellen] *********************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Repo ext-respondd klonen] ******************************************************************************************************** | + | TASK [wireguard : *wireguard* : Zugriffsrechte des Private Keys anpassen] |
- | <font style=" | + | <font style=" |
- | TASK [Systemd Startdatei für respondd kopieren] **************************************************************************************** | + | TASK [wireguard : *wireguard : *wireguard* : Zugriffsrechte des Public Keys anpassen] |
- | <font style=" | + | <font style=" |
- | TASK [Erstellen der resondd Konfigurationsdatei alias.json] **************************************************************************** | + | TASK [wireguard : *wireguard : *wireguard* : lokale link-local IPv6 Adresse aus dem PUBLIC-Key erzeugen] |
- | <font style=" | + | <font style=" |
- | TASK [Erstellen der resondd Konfigurationsdatei config.json] *************************************************************************** | + | TASK [wireguard : *wireguard* : private-key einlesen und in Variable übergeben] **************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Service ext-respondd beim Booten starten] **************************************************************************************** | + | TASK [wireguard : *wireguard* : public-key einlesen und in Variable übergeben] ***************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Paket hostapd für WLAN installieren] ********************************************************************************************* | + | TASK [wireguard : *wireguard* : Socket ermitteln] ********************************************************************************************************** |
- | <font style=" | + | <font style=" |
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
- | TASK [hostapd konfigurieren] *********************************************************************************************************** | + | TASK [wireguard : *wireguard* : link-local des Gateways ermitteln] |
- | <font style=" | + | <font style=" |
+ | <font style=" | ||
- | TASK [hostapd Konfigurationsdatei anlegen] | + | TASK [wireguard : *wireguard* : publickey des Gateways ermitteln] |
- | <font style=" | + | <font style=" |
+ | <font style=" | ||
- | TASK [wlan0 in Bridge packen] ********************************************************************************************************** | + | TASK [wireguard : *wireguard* : Konfigurationsdatei des wireguard-Tunnels erzeugen] |
- | <font style=" | + | <font style=" |
- | TASK [Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen] ********************** | + | TASK [wireguard : *wireguard* : systemd unit file für broker -Information anlegen] ************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Konfiguration des Client-VLAN ohne Mesh-Netz] ************************************************************************************ | + | TASK [wireguard : *wireguard* : Service broker starten beim Booten starten] |
- | <font style=" | + | <font style=" |
- | TASK [vxlan_id für ausgewähltes Segment ermitteln] ************************************************************************************* | + | TASK [wireguard : *wireguard* : Service wireguard via systemd starten] ************************************************************************************** |
- | <font style=" | + | <font style=" |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | <font style=" | + | |
- | TASK [Konfiguration des Mesh-VLAN ohne Client-VLAN] ************************************************************************************ | + | TASK [wireguard : *wireguard* : lokale link-local IPv6 Adresse aus dem PUBLIC-Key erzeugen] ***************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Konfiguration von Mesh- und Client-VLAN] ***************************************************************************************** | + | TASK [wireguard : *wireguard* : checkupscript zum Testen der wireguard-Verbindung anlegen] ****************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Konfiguration | + | TASK [wireguard : *wireguard* : Ausführungsrechte |
- | <font style=" | + | <font style=" |
- | TASK [Reboot am Ende] ****************************************************************************************************************** | + | TASK [wireguard : *wireguard* : crontab für minütlichen checkup der wireguard-Verbindung anlegen] |
- | <font style=" | + | <font style=" |
- | PLAY RECAP ***************************************************************************************************************************** | + | TASK [Installation von FASTD] ******************************************************************************************************************************* |
- | <font style=" | + | <font style=" |
- | </pre> | + | TASK [Verzeichnis für fastd- Konfigurationsdatei anlegen] *************************************************************************************************** |
- | </html> | + | <font style=" |
- | Nach dem letzten Reboot, der automatisch ausgeführt wird, finden wir unseren Offloader auf der Freifunkkarte: | + | TASK [Schlüssel für fastd erstellen] ************************************************************************************************************************ |
+ | <font style=" | ||
- | {{ :centos:ansible: | + | TASK [vxlan |
+ | <font style=" | ||
- | === Bsp. 2 : raspi_offloader_file.yml | + | TASK [vxlan : *VXLAN* : VXLAN-ID des gewählten Segments ermitteln] ****************************************************************************************** |
- | Falls noch nicht geschehen, ist es vor dem Aufruf des ansible-Playbooks notwendig, die Konfigurationsparameter in den Zeilen **'' | + | <font style=" |
- | $ vim raspi_offloader_file.yml +34 | + | skipping: [raspberry-wireguard] => (item={' |
+ | <font style=" | ||
+ | <font style=" | ||
+ | skipping: [raspberry-wireguard] | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={'key': ' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
- | <code> 34 | + | TASK [vxlan : *VXLAN* : link-local des Gateways ermitteln] ************************************************************************************************** |
- | | + | <font style=" |
- | | + | <font style="color: rgb(2, 110, 147)"> |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 41 | + | |
- | | + | |
- | | + | |
- | Haben wir die Informationen in dem Ansible-Playbook hinterlegt, können wir wie geohnt das Ansible-Scriptes ausführen. | + | TASK [vxlan : *VXLAN* : lokale link-local IPv6 Adresse aus dem PUBLIC-Key erzeugen] ************************************************************************* |
- | $ ansible-playbook ~/ | + | <font style=" |
- | < | + | TASK [vxlan |
- | <font style=" | + | <font style=" |
- | PLAY [raspi_offloader.yml] ************************************************************************************************************* | + | |
- | TASK [Gathering Facts] ***************************************************************************************************************** | + | TASK [vxlan : *VXLAN* : Ausführungsrechte des Bash-Scripts anpassen] |
- | <font style=" | + | <font style=" |
- | TASK [Hostname ändern] ***************************************************************************************************************** | + | TASK [vxlan : *VXLAN* : systemd-unitfile anlegen] |
- | <font style=" | + | <font style=" |
- | TASK [Anpassung /etc/hosts] ************************************************************************************************************ | + | TASK [vxlan : *VXLAN* : Neues Unitfile dem systemd bekannt geben] |
- | <font style=" | + | <font style=" |
- | TASK [Beschreibung des User ' | + | TASK [vxlan : *VXLAN* : Service vxlan via systemd starten] ************************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Service rfkill am Raspberry deaktivieren] **************************************************************************************** | + | TASK [ext-respondd : Installation der Pakete git und python3-netifaces] ************************************************************************************* |
- | <font style=" | + | <font style=" |
- | TASK [Update und Upgrade der APT-Pakete] *********************************************************************************************** | + | TASK [ext-respondd : Repo ext-respondd klonen] ************************************************************************************************************** |
- | <font style=" | + | <font style=" |
- | <font style=" | + | TASK [ext-respondd : Systemd Startdatei für respondd kopieren] ********************************************************************************************** |
+ | <font style=" | ||
- | TASK [Reboot nach update] ************************************************************************************************************** | + | TASK [ext-respondd : Erstellen der resondd Konfigurationsdatei alias.json] ********************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Download des aktuellen BATMAN Archives] ****************************************************************************************** | + | TASK [ext-respondd : Erstellen der resondd Konfigurationsdatei config.json] ********************************************************************************* |
- | <font style=" | + | <font style=" |
- | TASK [BATMAN-Archiv entpacken] ********************************************************************************************************* | + | TASK [ext-respondd : Service ext-respondd beim Booten starten] ********************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Installation des Dynamic Kernel Module Support Framework und der Header Files für den Raspberry Pi Linux Kernel] ***************** | + | TASK [hostapd : Paket hostapd |
- | <font style=" | + | <font style=" |
- | TASK [Rebuild BATMAN Kernel Header Dateien] ******************************************************************************************** | + | TASK [hostapd : hostapd konfigurieren] ********************************************************************************************************************** |
+ | <font style=" | ||
- | <font style=" | + | TASK [hostapd |
- | <font style=" | + | <font style=" |
- | TASK [Anlegen der dkms.conf für Dynamic Kernel Module Support] ************************************************************************* | + | TASK [hostapd : wlan0 in Bridge packen] ********************************************************************************************************************* |
- | <font style=" | + | <font style=" |
- | TASK [Dynamic Kernel Module Support hinzufügen] **************************************************************************************** | + | TASK [hostapd : Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen] ********************************* |
- | <font style=" | + | <font style=" |
- | TASK [Dynamic Kernel Module Support bauen] ********************************************************************************************* | + | TASK [client-mesh : Konfiguration des Client-VLAN ohne Mesh-Netz] ******************************************************************************************* |
- | <font style=" | + | <font style=" |
- | TASK [Dynamic Kernel Module Support installieren] ************************************************************************************** | + | TASK [client-mesh : vxlan_id für ausgewähltes Segment ermitteln] ******************************************************************************************** |
- | <font style=" | + | <font style=" |
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | <font style=" | ||
+ | <font style=" | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
+ | skipping: [raspberry-wireguard] => (item={' | ||
- | TASK [Laden des Kernelmodul beim Booten veranlassen] *********************************************************************************** | + | TASK [client-mesh : Konfiguration |
- | <font style=" | + | <font style=" |
- | TASK [Laden des BATMAN Moduls] ********************************************************************************************************* | + | TASK [client-mesh : Konfiguration von Mesh- und Client-VLAN] ************************************************************************************************ |
- | <font style=" | + | <font style=" |
- | TASK [Laden des dummy Moduls] ********************************************************************************************************** | + | TASK [client-mesh : Konfiguration |
- | <font style=" | + | <font style=" |
- | TASK [Installation der bridge-utils] ************************************************************************************************** | + | TASK [client-mesh : Konfiguration des bevorzugte Meshingpoint in BATMAN_V mit Wifi-Nutzung |
- | <font style=" | + | <font style=" |
- | TASK [Aktivierung von BATMAN_V] ******************************************************************************************************** | + | TASK [oled : Für OLED-Konfiguration i2c-bcm2708 in / |
- | <font style=" | + | <font style=" |
- | TASK [Konfiguration | + | TASK [oled : Für OLED-Konfiguration |
- | <font style=" | + | <font style=" |
- | TASK [Installation | + | TASK [oled : Installation |
- | <font style=" | + | <font style=" |
- | TASK [Verzeichnis für fastd- Konfigurationsdatei anlegen] ****************************************************************************** | + | TASK [oled : Laden des Kernelmodul i2c_arm beim Booten veranlassen] ***************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Schlüssel für fastd erstellen] *************************************************************************************************** | + | TASK [oled : Reboot nach Konfigurationsänderung] ************************************************************************************************************ |
- | <font style=" | + | <font style=" |
- | TASK [FASTD Secret Key aus / | + | TASK [oled : Repo Adafruit_Python_SSD1306 klonen] *********************************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [FASTD Socket ermitteln] ********************************************************************************************************** | + | TASK [oled : Für OLED-Konfiguration Adafruit_Python_SSD1306 installieren] *********************************************************************************** |
- | <font style=" | + | <font style=" |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | <font style=" | + | |
- | TASK [Erstellen der fastd Konfigurationsdatei] ***************************************************************************************** | + | TASK [oled : Script zur Anzeige klonen] ********************************************************************************************************************* |
- | <font style=" | + | <font style=" |
- | TASK [Service fastd beim Booten starten] *********************************************************************************************** | + | TASK [oled : Script zur Bandbreitenauslastung anpassen] ***************************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Installation der Pakete git und python3-netifaces] ******************************************************************************* | + | TASK [oled : Startscript für das OLED anlegen] ************************************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Repo ext-respondd klonen] ******************************************************************************************************** | + | TASK [oled : Service oled-bandwidth beim Booten starten] **************************************************************************************************** |
- | <font style=" | + | <font style=" |
- | TASK [Systemd Startdatei für respondd kopieren] **************************************************************************************** | + | TASK [final : Reboot nach Abschluss |
- | <font style=" | + | <font style=" |
- | + | ||
- | TASK [Erstellen | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Erstellen der resondd Konfigurationsdatei config.json] *************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Service ext-respondd beim Booten starten] **************************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Paket hostapd für WLAN installieren] ********************************************************************************************* | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [hostapd konfigurieren] *********************************************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [hostapd Konfigurationsdatei anlegen] ********************************************************************************************* | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [wlan0 in Bridge packen] ********************************************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen] ********************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Konfiguration | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [vxlan_id für ausgewähltes Segment ermitteln] ************************************************************************************* | + | |
- | <font style=" | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | skipping: [raspberry-ansible] => (item={' | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Konfiguration des Mesh-VLAN ohne Client-VLAN] ************************************************************************************ | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Konfiguration von Mesh- und Client-VLAN] ***************************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Konfiguration des bevorzugte Meshingpoint in BATMAN_V] *************************************************************************** | + | |
- | <font style=" | + | |
- | + | ||
- | TASK [Reboot am Ende] ****************************************************************************************************************** | + | |
- | <font style=" | + | |
PLAY RECAP ***************************************************************************************************************************** | PLAY RECAP ***************************************************************************************************************************** | ||
- | <font style=" | + | <font style=" |
</ | </ | ||
</ | </ | ||
+ | Auch hier wird nach Beendigung des Ansible-Laufs der Knoten auf der Freifunkkarte an der gewünschten Stelle auftauchen. | ||
+ | Nach dem letzten Reboot, der automatisch ausgeführt wird, finden wir unseren Offloader auf der Freifunkkarte: | ||
+ | {{ : | ||
====== Links ====== | ====== Links ====== |