Skip to content

Commit

Permalink
Support Freifunk Wertingen and Freifunk Donau-Ries domains
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett committed Nov 22, 2023
1 parent bc30db2 commit 2270903
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
5 changes: 3 additions & 2 deletions dhcp-server/isc-dhcp-server.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ After=syslog.target network-online.target
Type=forking
User=root
Group=root
{% set sites = salt['pillar.get']('netbox:config_context:sites').values()|sum(start=[]) -%}
{% if 'vrf_external' in salt['grains.get']('ip_interfaces') %}
ExecStart=/sbin/ip vrf exec vrf_external /usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf {% for site in salt['pillar.get']('netbox:config_context:sites') -%} br-{{ site }} {% endfor %}
ExecStart=/sbin/ip vrf exec vrf_external /usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf {% for site in sites -%} br-{{ site }} {% endfor %}
{% else %}
ExecStart=/usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf {% for site in salt['pillar.get']('netbox:config_context:sites') -%} br-{{ site }} {% endfor %}
ExecStart=/usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf {% for site in sites -%} br-{{ site }} {% endfor %}
{% endif %}
[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion icinga2/host.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- set roles = salt['mine.get'](node_id,'minion_roles')[node_id] %}
{%- set role = salt['mine.get'](node_id,'minion_role')[node_id] %}
{%- set device_role = salt['mine.get'](node_id,'minion_device_role')[node_id] %}
{%- set sites = salt['pillar.get']('netbox:config_context:sites') %}
{%- set sites = salt['pillar.get']('netbox:config_context:sites').values()|sum(start=[]) %}
{%- set address = salt['mine.get'](node_id,'minion_address', tgt_type='glob')[node_id] %}
{%- set overlay_address = salt['mine.get'](node_id,'minion_overlay_address', tgt_type='glob')[node_id] %}
{%- set address6 = salt['mine.get'](node_id,'minion_address6', tgt_type='glob')[node_id] %}
Expand Down
2 changes: 1 addition & 1 deletion radvd/radvd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Managed by salt
#

{% for site in salt['pillar.get']('netbox:config_context:sites') %}
{% for site in salt['pillar.get']('netbox:config_context:sites').values()|sum(start=[]) %}
interface br-{{ site }}
{
AdvSendAdvert on;
Expand Down
2 changes: 1 addition & 1 deletion respondd/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
python3-netifaces:
pkg.installed

{% for site in salt['pillar.get']('netbox:config_context:sites') %}
{% for site in salt['pillar.get']('netbox:config_context:sites').values()|sum(start=[]) %}

{% if not salt['file.directory_exists']('/opt/respondd-' ~ site ) %}
/opt/respondd-{{ site }}:
Expand Down
16 changes: 8 additions & 8 deletions systemd-networkd/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ systemd-networkd-reload:
- template: jinja
interface: {{ iface }}
mac: {{ interfaces[iface]['mac_address'] }}
desc: {{ interfaces[iface]['description'] }}
desc: "{{ interfaces[iface]['description'] }}"
- watch_in:
- cmd: generate_initrd
- cmd: systemd-networkd-reload
Expand All @@ -123,7 +123,7 @@ systemd-networkd-reload:
- source: salt://systemd-networkd/files/systemd-netdev.jinja2
- template: jinja
interface: {{ iface }}
desc: {{ interfaces[iface]['description'] }}
desc: "{{ interfaces[iface]['description'] }}"
kind: "dummy"
- watch_in:
- cmd: systemd-networkd-reload
Expand All @@ -134,7 +134,7 @@ systemd-networkd-reload:
- source: salt://systemd-networkd/files/systemd-netdev.jinja2
- template: jinja
interface: {{ iface }}
desc: {{ interfaces[iface]['description'] }}
desc: "{{ interfaces[iface]['description'] }}"
kind: "wireguard"
- watch_in:
- cmd: systemd-networkd-reload
Expand All @@ -145,7 +145,7 @@ systemd-networkd-reload:
- source: salt://systemd-networkd/files/systemd-netdev.jinja2
- template: jinja
interface: {{ iface }}
desc: {{ interfaces[iface]['description'] }}
desc: "{{ interfaces[iface]['description'] }}"
kind: "vxlan"
- watch_in:
- cmd: systemd-networkd-reload
Expand All @@ -156,7 +156,7 @@ systemd-networkd-reload:
- source: salt://systemd-networkd/files/systemd-netdev.jinja2
- template: jinja
interface: {{ iface }}
desc: {{ interfaces[iface]['description'] }}
desc: "{{ interfaces[iface]['description'] }}"
kind: "batadv"
- watch_in:
- cmd: systemd-networkd-reload
Expand All @@ -167,7 +167,7 @@ systemd-networkd-reload:
- source: salt://systemd-networkd/files/systemd-netdev.jinja2
- template: jinja
interface: {{ iface }}
desc: {{ interfaces[iface]['description'] }}
desc: "{{ interfaces[iface]['description'] }}"
kind: "bridge"
- watch_in:
- cmd: systemd-networkd-reload
Expand All @@ -178,7 +178,7 @@ systemd-networkd-reload:
- source: salt://systemd-networkd/files/systemd-netdev.jinja2
- template: jinja
interface: {{ iface }}
desc: {{ interfaces[iface]['description'] }}
desc: "{{ interfaces[iface]['description'] }}"
kind: "ip6gre"
- watch_in:
- cmd: systemd-networkd-reload
Expand All @@ -190,7 +190,7 @@ systemd-networkd-reload:
- source: salt://systemd-networkd/files/systemd-network.jinja2
- template: jinja
interface: {{ iface }}
desc: {{ interfaces[iface]['description'] }}
desc: "{{ interfaces[iface]['description'] }}"
ipaddresses: {{ interfaces[iface]['ipaddresses'] }}
gateway: {{ gateway }}
- watch_in:
Expand Down
6 changes: 3 additions & 3 deletions yanic/yanic.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ synchronize = "1m"
collect_interval = "1m"

[respondd.sites.ffmuc]
domains = [{% for site in sites %}"ffmuc_{{ site }}", {% endfor %}]
domains = [{% for site, domains in sites.items() %}{% for domain in domains %}"{{site}}_{{ domain }}", {% endfor %}{% endfor %}]

# interface that has an IP in your mesh network
{%- for site in sites %}
{%- for domain in sites.values()|sum(start=[]) %}
[[respondd.interfaces]]
ifname = "br-{{ site }}"
ifname = "br-{{ domain }}"
port = 45124
{% endfor %}

Expand Down

0 comments on commit 2270903

Please sign in to comment.