Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| linux:ansible:ffmuc-rpb4-ol [27.09.2022 15:17. ] – [Templates] django | linux:ansible:ffmuc-rpb4-ol [18.11.2024 18:58. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 11: | Zeile 11: | ||
| ====== Inhalt ====== | ====== Inhalt ====== | ||
| - | |||
| - | <WRAP center round alert 30%> | ||
| - | **ACHTUNG: | ||
| - | </ | ||
| - | |||
| <WRAP center round tip 90%> | <WRAP center round tip 90%> | ||
| Zeile 1076: | Zeile 1071: | ||
| # see man systemd.unit | # see man systemd.unit | ||
| Description=Inform tunnel about our wireguard-public key | Description=Inform tunnel about our wireguard-public key | ||
| - | Documentation=https:// | + | Documentation=https:// |
| Before=wg-quick.target | Before=wg-quick.target | ||
| Zeile 1233: | Zeile 1228: | ||
| # see man systemd.unit | # see man systemd.unit | ||
| Description=Bringing up VXLAN Interface | Description=Bringing up VXLAN Interface | ||
| - | Documentation=https:// | + | Documentation=https:// |
| After=wg-quick@wg-uplink.service | After=wg-quick@wg-uplink.service | ||
| Zeile 1264: | Zeile 1259: | ||
| === Rolle " | === Rolle " | ||
| == Tasks == | == Tasks == | ||
| - | < | + | < |
| - include: gitinstall.yml | - include: gitinstall.yml | ||
| - include: gitclone.yml | - include: gitclone.yml | ||
| Zeile 1273: | Zeile 1268: | ||
| </ | </ | ||
| - | <file java ~/ | ||
| - | - name: " | ||
| - | # https:// | ||
| - | template: | ||
| - | src: templates/ | ||
| - | dest: / | ||
| - | </ | ||
| - | < | + | < |
| - | - name: " | + | |
| - | # https:// | + | |
| - | template: | + | |
| - | src: templates/ | + | |
| - | dest: / | + | |
| - | </ | + | |
| - | <file java ~/ | + | - name: "Installation der Pakete git und python3-netifaces" |
| - | | + | ansible.builtin.apt: |
| - | # https:// | + | |
| - | | + | pkg: |
| - | | + | - git |
| - | </ | + | |
| + | | ||
| - | <file java ~/ | + | ...</ |
| - | - name: "Repo ext-respondd klonen" | + | |
| - | # https:// | + | |
| - | git: | + | |
| - | repo: https:// | + | |
| - | dest: / | + | |
| - | </ | + | |
| - | <file java ~/ | ||
| - | - name: " | ||
| - | # https:// | ||
| - | apt: | ||
| - | update_cache: | ||
| - | pkg: | ||
| - | - git | ||
| - | - python3-netifaces | ||
| - | state: present | ||
| - | </ | ||
| - | < | + | |
| - | - name: "Service | + | < |
| - | | + | |
| - | systemd: | + | - name: "ggf. bestehende Altlast bereinigen" |
| - | name: ext-respondd | + | |
| - | daemon_reload: | + | path: / |
| - | state: started | + | state: absent |
| - | enabled: | + | |
| - | </ | + | - name: "Repo ext-respondd |
| + | ansible.builtin.git: | ||
| + | | ||
| + | dest: / | ||
| + | version: master | ||
| + | clone: true | ||
| + | update: true | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | |||
| + | <file c++ ~/ansible/ | ||
| + | |||
| + | - name: " | ||
| + | ansible.builtin.copy: | ||
| + | src: / | ||
| + | dest: / | ||
| + | remote_src: true | ||
| + | # cmd: cp / | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | |||
| + | <file c++ ~/ansible/roles/ext-respondd/tasks/ | ||
| + | |||
| + | - name: " | ||
| + | ansible.builtin.template: | ||
| + | | ||
| + | dest: / | ||
| + | owner: root | ||
| + | group: root | ||
| + | mode: ' | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | <file c++ ~/ | ||
| + | |||
| + | - name: " | ||
| + | ansible.builtin.template: | ||
| + | src: templates/ | ||
| + | dest: / | ||
| + | owner: root | ||
| + | group: root | ||
| + | mode: ' | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | <file c++ ~/ | ||
| + | |||
| + | - name: "Typo in der / | ||
| + | ansible.builtin.replace: | ||
| + | path: / | ||
| + | # zu ersetzende/ | ||
| + | regexp: ' | ||
| + | # wird ersetzt durch | ||
| + | replace: ' | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | <file c++ ~/ | ||
| + | |||
| + | - name: " | ||
| + | | ||
| + | name: ext-respondd | ||
| + | daemon_reload: | ||
| + | state: started | ||
| + | enabled: | ||
| + | |||
| + | ...</ | ||
| == Templates == | == Templates == | ||
| - | < | + | < |
| " | " | ||
| " | " | ||
| Zeile 1345: | Zeile 1381: | ||
| }, | }, | ||
| " | " | ||
| - | } | + | }</ |
| - | </ | + | |
| <file java ~/ | <file java ~/ | ||
| Zeile 1355: | Zeile 1390: | ||
| " | " | ||
| " | " | ||
| - | } | + | }</ |
| - | </ | + | |
| === Rolle " | === Rolle " | ||
| == Tasks == | == Tasks == | ||
| - | < | + | < |
| - include: install.yml | - include: install.yml | ||
| - include: configure.yml | - include: configure.yml | ||
| - include: genconfig.yml | - include: genconfig.yml | ||
| - include: wlanbridging.yml | - include: wlanbridging.yml | ||
| - | - include: servicestartup.yml | + | - include: servicestartup.yml |
| - | </ | + | # und so das Laden der Unit Datei vom Service |
| + | # hostapd ermöglichen | ||
| + | ... # YML Ende</ | ||
| - | <file java ~/ | ||
| - | - name: " | ||
| - | # https:// | ||
| - | shell: echo ' | ||
| - | when: ( raspberry_wifi == " | ||
| - | </ | ||
| - | < | + | < |
| - | - name: " | + | |
| - | # https:// | + | |
| - | template: | + | |
| - | src: templates/ | + | |
| - | dest: / | + | |
| - | when: ( raspberry_wifi == " | + | |
| - | </ | + | |
| - | < | + | - name: "Paket hostapd für WLAN installieren" |
| - | - name: "Paket hostapd | + | ansible.builtin.apt: |
| - | | + | update_cache: |
| - | | + | pkg: |
| - | | + | - hostapd |
| - | pkg: | + | state: present |
| - | | + | |
| - | state: present | + | ...</ |
| - | | + | |
| - | </ | + | |
| + | < | ||
| + | |||
| + | - name: " | ||
| + | ansible.builtin.command: | ||
| + | | ||
| + | changed_when: false | ||
| + | |||
| + | ...</file> | ||
| + | |||
| + | <file c++ ~/ | ||
| + | |||
| + | - name: " | ||
| + | | ||
| + | src: templates/hostapd.j2 | ||
| + | dest: /etc/hostapd/hostapd.conf | ||
| + | | ||
| + | group: root | ||
| + | mode: ' | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | |||
| + | <file c++ ~/ | ||
| + | |||
| + | - name: "wlan0 in Bridge packen" | ||
| + | template: | ||
| + | | ||
| + | dest: / | ||
| + | owner: root | ||
| + | group: root | ||
| + | mode: ' | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | |||
| + | <file c++ ~/ | ||
| + | |||
| + | - name: "Service hostapd beim Booten und jetzt starten und das Laden der Unit Datei vom Service hostapd ermöglichen" | ||
| + | | ||
| + | name: hostapd | ||
| + | enabled: true | ||
| + | masked: false | ||
| + | state: started | ||
| + | |||
| + | ...</ | ||
| - | <file java ~/ | ||
| - | - name: " | ||
| - | # https:// | ||
| - | systemd: | ||
| - | name: hostapd | ||
| - | enabled: yes | ||
| - | masked: no | ||
| - | state: started | ||
| - | when: ( raspberry_wifi == " | ||
| - | </ | ||
| - | <file java ~/ | ||
| - | - name: "wlan0 in Bridge packen" | ||
| - | # https:// | ||
| - | template: | ||
| - | src: templates/ | ||
| - | dest: / | ||
| - | when: ( raspberry_wifi == " | ||
| - | </ | ||
| == Templates == | == Templates == | ||
| - | < | + | < |
| country_code=US | country_code=US | ||
| Zeile 1447: | Zeile 1497: | ||
| vht_oper_chwidth=1 | vht_oper_chwidth=1 | ||
| channel=36 | channel=36 | ||
| - | vht_oper_centr_freq_seg0_idx=42 | + | vht_oper_centr_freq_seg0_idx=42</ |
| - | </ | + | |
| <file java ~/ | <file java ~/ | ||
| + | # Generated by Ansible on {{ ansible_date_time.date }}, do not edit manually! | ||
| # | # | ||
| # rc.local | # rc.local | ||
| Zeile 1469: | Zeile 1520: | ||
| fi | fi | ||
| sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | ||
| - | exit 0 | + | exit 0</ |
| - | </ | + | |
| === Rolle " | === Rolle " | ||
| == Tasks == | == Tasks == | ||
| - | < | + | < |
| - include: clientohnemesh.yml | - include: clientohnemesh.yml | ||
| - include: getvxlanid.yml | - include: getvxlanid.yml | ||
| Zeile 1482: | Zeile 1532: | ||
| - include: batmanohnewifi.yml | - include: batmanohnewifi.yml | ||
| - include: batmanmitwifi.yml | - include: batmanmitwifi.yml | ||
| - | </ | + | ... # YML Ende</ |
| - | <file java ~/ | ||
| - | - name: " | ||
| - | # https:// | ||
| - | template: | ||
| - | src: templates/ | ||
| - | dest: / | ||
| - | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi == " | ||
| - | </ | ||
| - | < | + | < |
| - | - name: " | + | |
| - | # https:// | + | |
| - | template: | + | |
| - | src: templates/ | + | |
| - | dest: / | + | |
| - | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi != " | + | |
| - | </ | + | |
| - | <file java ~/ | + | - name: " |
| - | --- | + | ansible.builtin.template: |
| - | | + | src: templates/ |
| - | # https:// | + | dest: / |
| - | | + | |
| - | src: templates/ | + | group: root |
| - | dest: / | + | mode: ' |
| - | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length == 0 ) | + | |
| - | </ | + | |
| - | <file java ~/ | + | ...</ |
| - | - name: " | + | |
| - | # https:// | + | |
| - | set_fact: | + | |
| - | ffmuc_vxlan_id: | + | |
| - | loop: "{{ lookup(' | + | |
| - | when: " | + | |
| - | </ | + | |
| - | < | + | < |
| - | - name: " | + | |
| - | # https:// | + | |
| - | template: | + | |
| - | src: templates/ | + | |
| - | dest: / | + | |
| - | when: ( raspberry_clientvlan|length == 0 ) and ( raspberry_meshvlan|length > 0 ) | + | |
| - | </ | + | |
| - | < | + | - name: " |
| - | - name: " | + | ansible.builtin.set_fact: |
| - | | + | ffmuc_vxlan_id: |
| - | template: | + | loop: "{{ lookup(' |
| - | src: templates/ | + | when: " |
| - | dest: / | + | |
| - | when: ( raspberry_clientvlan|length > 0 ) and ( raspberry_meshvlan|length > 0 ) | + | ...</file> |
| - | </ | + | |
| + | <file c++ ~/ | ||
| + | |||
| + | - name: " | ||
| + | ansible.builtin.template: | ||
| + | | ||
| + | dest: /etc/ | ||
| + | owner: root | ||
| + | group: root | ||
| + | mode: ' | ||
| + | when: ( raspberry_clientvlan|length == 0 ) and ( raspberry_meshvlan|length > 0 ) | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | |||
| + | <file c++ ~/ansible/roles/client-mesh/tasks/ | ||
| + | |||
| + | - name: " | ||
| + | ansible.builtin.template: | ||
| + | src: templates/ | ||
| + | dest: / | ||
| + | | ||
| + | group: root | ||
| + | mode: ' | ||
| + | | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | <file c++ ~/ | ||
| + | |||
| + | - name: " | ||
| + | ansible.builtin.template: | ||
| + | src: templates/ | ||
| + | dest: / | ||
| + | owner: root | ||
| + | group: root | ||
| + | mode: ' | ||
| + | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi != " | ||
| + | |||
| + | ...</ | ||
| + | |||
| + | |||
| + | <file c++ ~/ | ||
| + | |||
| + | - name: " | ||
| + | ansible.builtin.template: | ||
| + | src: templates/ | ||
| + | dest: / | ||
| + | owner: root | ||
| + | group: root | ||
| + | mode: ' | ||
| + | when: ( raspberry_meshvlan|length > 0 ) and ( raspberry_wifi == " | ||
| + | |||
| + | ...</ | ||
| == Templates == | == Templates == | ||
| - | < | + | < |
| + | # interfaces(5) file used by ifup(8) and ifdown(8) | ||
| # Please note that this file is written to be used with dhcpcd | # Please note that this file is written to be used with dhcpcd | ||
| Zeile 1565: | Zeile 1639: | ||
| pre-up / | pre-up / | ||
| pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | 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 ' | + | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' |
| - | </ | + | |
| - | < | + | |
| + | < | ||
| + | # interfaces(5) file used by ifup(8) and ifdown(8) | ||
| # Please note that this file is written to be used with dhcpcd | # Please note that this file is written to be used with dhcpcd | ||
| Zeile 1605: | Zeile 1680: | ||
| </ | </ | ||
| - | <file java ~/ | + | |
| + | <file java ~/ | ||
| + | # interfaces(5) file used by ifup(8) and ifdown(8) | ||
| # Please note that this file is written to be used with dhcpcd | # Please note that this file is written to be used with dhcpcd | ||
| Zeile 1636: | Zeile 1713: | ||
| pre-up / | pre-up / | ||
| pre-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' | 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 ' | + | post-up /sbin/ip link set address $(ip -br l | grep eth0 | egrep -o ' |
| - | </ | + | |
| <file bash ~/ | <file bash ~/ | ||
| + | # Generated by Ansible on {{ ansible_date_time.date }}, do not edit manually! | ||
| # | # | ||
| # rc.local | # rc.local | ||
| Zeile 1659: | Zeile 1737: | ||
| sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | sleep 10; /sbin/brctl addif br-{{ ffmuc_segment }} wlan0 | ||
| / | / | ||
| - | exit 0 | + | exit 0</ |
| - | </ | + | |
| <file bash ~/ | <file bash ~/ | ||
| + | # Generated by Ansible on {{ ansible_date_time.date }}, do not edit manually! | ||
| # | # | ||
| # rc.local | # rc.local | ||
| Zeile 1681: | Zeile 1760: | ||
| fi | fi | ||
| / | / | ||
| - | exit 0 | + | exit 0</ |
| - | </ | + | |
| + | /* | ||
| === Rolle " | === Rolle " | ||
| == Tasks == | == Tasks == | ||
| Zeile 2110: | Zeile 2188: | ||
| # see man systemd.unit | # see man systemd.unit | ||
| Description=Starting OLED-Trafic output | Description=Starting OLED-Trafic output | ||
| - | Documentation=https:// | + | Documentation=https:// |
| After=network.target | After=network.target | ||
| Zeile 2123: | Zeile 2201: | ||
| </ | </ | ||
| + | */ | ||
| === Rolle " | === Rolle " | ||
| == Tasks == | == Tasks == | ||
| <file java ~/ | <file java ~/ | ||
| - | - include: reboot.yml | + | - include: reboot.yml |
| - | ... #YAML Ende Syntax | + | ... # YML Ende</ |
| - | </ | + | |
| <file java ~/ | <file java ~/ | ||
| - | | + | |
| - | # https:// | + | - name: " |
| - | | + | ansible.builtin.reboot: |
| - | </ | + | |
| + | ...</ | ||
| ==== Download des auf Debian Buster basierenden Raspbian ==== | ==== Download des auf Debian Buster basierenden Raspbian ==== | ||
| Zeile 2259: | Zeile 2339: | ||
| Hier werden die zur Konfiguration benötigten Parameter nicht beim Aufruf des Playbooks abgefragt, sondern in zugehörigen **[[# | Hier werden die zur Konfiguration benötigten Parameter nicht beim Aufruf des Playbooks abgefragt, sondern in zugehörigen **[[# | ||
| - | In den Zeilen **'' | + | In der Host-spezifischen Konfigurationsdatei |
| - | $ vim ~/ | + | $ vim ~/ |
| + | |||
| + | < | ||
| + | # stationäre schwarzes Plastikgehäuse Raspberry 4B mit PoE-HAT und Display | ||
| + | # MAC: dc: | ||
| + | ansible_ssh_host: | ||
| + | ansible_port: | ||
| + | ansible_user: | ||
| + | ansible_ssh_private_key_file: | ||
| + | # | ||
| + | batman_adv_version: | ||
| + | ffmuc_segment: | ||
| + | ffmuc_gateway: | ||
| + | raspberry_hostname: | ||
| + | node_contact_address: | ||
| + | raspberry_latitude: | ||
| + | raspberry_longitude: | ||
| + | raspberry_wifi: | ||
| + | raspberry_clientvlan: | ||
| + | raspberry_meshvlan: | ||
| + | raspberry_oled: | ||
| - | < | + | Diese passen wir natürlich noch auf unsere lokale Umgebung hin an. |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| === Playbook Lauf === | === Playbook Lauf === | ||
| Zeile 2595: | Zeile 2685: | ||
| * **[[wiki: | * **[[wiki: | ||
| * **[[http:// | * **[[http:// | ||
| + | |||