Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init location "FBLipke" and device "nsm2_xw" #934

Closed
wants to merge 255 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
1d29464
suedblock: new corerouter cudy_x6
pktpls Aug 13, 2024
0b47bb9
kiezladen154: fix config typo
Noki Aug 13, 2024
91475a1
workflows: added VID / VLAN name duplication check
Noki Jul 28, 2024
2eceb5e
fardf: init location
Noki Aug 4, 2024
20f1f04
version: switch snapshot back to snapshot feed
pktpls Jul 19, 2024
ca405b7
imageprofile: fix compatibility with snapshot falter-common dependencies
pktpls Jul 25, 2024
49c6107
pktpls: upgrade to snapshot
pktpls Jul 25, 2024
fb136a3
mela: fix mesh-o5; improve config
Noki Aug 17, 2024
72e7f14
torte-mela-2g: retired
Noki Aug 19, 2024
d5718a1
gub37,k12: fix missing mac_overrides
Noki Aug 24, 2024
8d0f579
workflows: consolidate duplicate checks
Noki Aug 18, 2024
784cd6f
klunker: fix mac_overrides; add PoE watchdog to instable device
Noki Aug 18, 2024
daba579
k12-haus4: replace AP
Noki Aug 24, 2024
b419cc9
w38b: temp replacement for wax202~
Noki Aug 27, 2024
c898237
noki: additions to test and travel setup
Noki Aug 27, 2024
35321f0
scripts: make mass-update check available memory instead of free memory
Noki Aug 27, 2024
3c576bf
model: fix cudy_x6 DSA ports
pktpls Aug 16, 2024
7864a9a
kub: automate custom VLAN tagging on kub-ap1
pktpls Aug 16, 2024
982ad95
sav: fix custom port config
FFHener Aug 27, 2024
c59ce10
ilr: fix custom port config
FFHener Aug 27, 2024
01637a1
hacrafu-armarian09: init location
ZuquetuPlexis Aug 27, 2024
182ff78
k11: swap core-router, remove AP
Noki Aug 27, 2024
99f59ec
rhnk: the Belkin corerouter is safe to use
pktpls Aug 30, 2024
4e01b28
kiehlufer: new cudy_x6 corerouter
pktpls Aug 19, 2024
3d999a0
system: make log_size configurable
pktpls Aug 28, 2024
eb937e2
suedblock: new IPs with real mgmt network
pktpls Aug 28, 2024
9c36339
all: mt76 driver debugging
pktpls Aug 30, 2024
c7f2782
gateway: allow incoming to radbahn, for mt76 debugging
pktpls Sep 2, 2024
c149393
ak36-gw: add v6 uplink (#960)
nicolasberens Sep 10, 2024
aee5a22
model: split ubnt bullet into m2 and m5
Noki Aug 24, 2024
f19de44
jup,ska95: use renamed model file
Noki Aug 28, 2024
f2bd978
packages: no debug packages with low_mem
Noki Aug 27, 2024
dfdf946
packages: also remove other iwinfo related packages
Noki Aug 27, 2024
1a3328e
model: add requires_mac_override setting
Noki Aug 30, 2024
86ff9f6
workflows: check for missing mac_overrides
Noki Aug 30, 2024
6efcdaf
gateway: allow DNS to bypass stateful tracking, ratelimited.
spolack Aug 27, 2024
17e17be
gateway: fix logic error in tcp syn/ack bypass
spolack Aug 27, 2024
91be955
linie206: replace corerouter with Routerboard 750gr3
pktpls Sep 4, 2024
b887478
gateways: added collectd-mod-snmp to fix monitoring (#967)
Noki Sep 13, 2024
7ab1775
corerouter/gateway: configure olsrd6 solely for name resolution
spolack Sep 13, 2024
dcd0bd0
gateway/corerouter: reenable olsrd6 :)
spolack Sep 13, 2024
239cb33
workflows: perform mac-override-check only on changed files
Noki Sep 22, 2024
a8e0d52
docs: added information about mac_override
Noki Sep 22, 2024
ca88560
model: add TOTOLINK A7000R
PolynomialDivision Sep 17, 2024
2c345b5
tempelwg: add new location
PolynomialDivision Sep 17, 2024
7df84d9
corerouter: implement olsrd-babel ipv4 soft migration
spolack Aug 10, 2024
3becaa7
olsrd: unify suffix
Noki Sep 20, 2024
486a714
hts4: deactivate roaming, change channel
Noki Jul 25, 2024
97c5b2a
bbbvpn is on another interface (#975)
nicolasberens Sep 23, 2024
3fd578c
magda: added airos-dfs-reset config
FFHener Sep 23, 2024
a94f915
emma: new corerouter, fritzbox again unstable
pktpls Sep 17, 2024
c71ad2c
rigaer78: fix channel assignments
PolynomialDivision Sep 23, 2024
9f756d1
muggel: remove OpenSSL, defaults are fine now
pktpls Sep 24, 2024
0f47c0e
muggel: use USB LTE modem for uplink
pktpls Sep 24, 2024
497625a
workflows: fix handling file patterns; add channel assignment duplicates
Noki Sep 23, 2024
5c5a83b
tunspace: private key is now always ephemeral
pktpls Sep 20, 2024
2f12cac
tunspace: support for direct uplink interface usage
pktpls Sep 20, 2024
004d575
cleanup: remove old tunnelmanager things
pktpls Sep 20, 2024
83baf17
model: add GL.iNet Beryl AX (GL-MT3000)
Noki Sep 23, 2024
39cb7b0
fiocchi, gigli, girandole: Add real mac adr
ZuquetuPlexis Sep 28, 2024
2fd263b
hacrafu-gobbetti: init location
ZuquetuPlexis Sep 28, 2024
ce3a029
workflows: sanity check for interface names
Noki Sep 29, 2024
2776a52
gub37: Format yaml according to Zed preferences
robertfoss Oct 2, 2024
9d355a0
gub37: Update contact info
robertfoss Oct 2, 2024
01524ee
gub37: Rework IPv4 subnet partitioning
robertfoss Oct 2, 2024
d271248
gub37: Create local dhcp networks
robertfoss Oct 2, 2024
1f72e1e
gub37: Clean up mgmt IPv4 addresses
robertfoss Oct 2, 2024
c8f28ec
gateway: Add inbound_allow for gub37 local public subnet
robertfoss Oct 2, 2024
5a61789
newyorck: make uplink v50 untagged
noxilixon Oct 2, 2024
b9396eb
c-base: init location
nicolasberens Sep 7, 2024
c1c1342
gub37: Fix DHCP IPv4 subnet
robertfoss Oct 2, 2024
ea7bb98
scripts: improve mass-update script
Noki Oct 7, 2024
1bd6db1
add cralle-west-nf
pmelange Sep 28, 2024
d906439
wikiupdater: fix building of variable
FFHener Oct 1, 2024
f83eb08
Refactor some common network config features into libnetwork
spolack Oct 3, 2024
7ab71dd
liese-21: add port documentation
FFHener Oct 8, 2024
42e2949
model: add GL.iNet Flint 2 (GL-MT6000)
Noki Oct 8, 2024
76a60fc
w38b: new core router
Noki Oct 8, 2024
0b4b802
chris: update config to current state
Noki Aug 25, 2024
6708fee
mela: update config to current state
Noki Aug 25, 2024
15456a3
gruni73: document PoE watchdog
Noki Oct 6, 2024
f051426
rhnk, zwingli: added SNMP monitoring for switches
Noki Oct 13, 2024
020a500
manstein10: adjust config to reflect current state
Noki Oct 13, 2024
1aaa2e7
forcki: added again
FFHener Oct 14, 2024
d76223d
forcki: add 2.4GHz mesh for core
FFHener Oct 14, 2024
8f448ca
zwingli: change mgmt VLAN; add wave nano; add mac override
Noki Oct 15, 2024
77c85cd
w38b: adjust metrics
Noki Oct 15, 2024
2422fde
emma: add missing metrics
Noki Oct 15, 2024
38195d7
k12, hirschhof: bring some order into the setup
Noki Oct 17, 2024
28dbaf6
mesh: fixed / added missing mesh metrics
Noki Oct 16, 2024
5760132
nftables: filter reflected packets only on mesh APs
pktpls Oct 15, 2024
664adc4
model: Add Cudy AP3000 Outdoor v1
robertfoss Oct 20, 2024
3111ea7
multiple locations: fix mesh_metric variable name
Noki Oct 19, 2024
d7b6a41
ohlauer: set speed to correct value
Noki Oct 20, 2024
b65c7e6
w38b: adjust mesh metrics
Noki Oct 20, 2024
52ca7d6
zwingli: adjust mesh metrics
Noki Oct 20, 2024
0f94751
wireless: Default to country 'DE'
robertfoss Oct 20, 2024
85eeef7
wireless: Default legacy_rates to '0'
robertfoss Oct 20, 2024
3aa468b
templates: Enable wireless devices / wd_config to be unset
robertfoss Oct 20, 2024
d27ab8c
Remove empty devices: declarations
robertfoss Oct 20, 2024
dadacfd
DEVELOPER.md: Add example radio options
robertfoss Oct 20, 2024
fe0cb24
w38b: fix OWE for windows devices
Noki Oct 22, 2024
902c8fb
wireless: Revert whitespace change in previous template change
robertfoss Oct 22, 2024
daafb0b
wireless: Remove "No config provided" comment
robertfoss Oct 22, 2024
77504e8
nftables: Fix syntax formatting
robertfoss Oct 22, 2024
42a1cf9
treewide: remove mt76 debugging
pktpls Oct 21, 2024
93da66e
radbahn: do snapshot and mbedtls on core too
pktpls Oct 22, 2024
0123221
c-base: fix nf mesh
Noki Oct 22, 2024
b6d283e
l105: set bbb-vpn mesh metric to be idendical to ak36-gw and strom-gw
Noki Oct 22, 2024
115b0f9
newyorck: add additional ap
noxilixon Oct 23, 2024
bcbb2b1
walde: enable mesh at core
Noki Oct 23, 2024
0e8b990
emma: remove emma-ono-5ghz
FFHener Oct 23, 2024
804a227
emma: formatting of config file
FFHener Oct 23, 2024
b2c5741
walde: fix ip in snmp_section for walde-emma
FFHener Oct 24, 2024
5f5cce2
w38b: make ap1 freifunk_default
Noki Oct 24, 2024
4f29940
imageprofile: return to MbedTLS, it now supports everything we need
pktpls Oct 22, 2024
5069887
treewide: remove ssl packages overrides
pktpls Oct 22, 2024
15707a5
collectd: only load iwinfo plugin on non low_mem or _flash devices
FFHener Oct 25, 2024
bcb55a8
gruni73, fardf: improve documentation of watchdogs
Noki Oct 25, 2024
13f574b
zwingli: device was changed
Noki Oct 25, 2024
867263f
w38b: add network
Noki Oct 26, 2024
87b3d41
w38b: add new device
Noki Oct 28, 2024
ea6be3a
segen: adjust mesh metrics
Noki Oct 30, 2024
0c40ef8
k12, hirschhof: adjust mesh metrics & mesh setup
Noki Oct 30, 2024
8d73b76
magda: added City to address
FFHener Oct 30, 2024
b0f58b8
magda: comment out ap4 until it gets replaced
FFHener Oct 30, 2024
8ed4404
vaterhaus: add airos-dfs-reset config
spolack Oct 31, 2024
2cb4bc4
vm: firecracker supports ACPI now
pktpls Oct 25, 2024
75bf4a9
imageprofile: fix TLS certificate generation
pktpls Nov 2, 2024
17e59e3
model_cudy_ap3000outdoor_v1: fix version_nice
FFHener Oct 26, 2024
a9cdab1
teufelsberg: add 2 new aps replacing 1
FFHener Oct 26, 2024
a478d2e
teufelsberg: rename nf aps
FFHener Oct 30, 2024
6610aa7
teufelsberg: add raspi from meshtastic
FFHener Oct 28, 2024
76a6472
teufelsberg: set frequencies for 2ghz-devices
FFHener Oct 30, 2024
9c69ca8
imageprofile: roll back luci-ssl
Noki Nov 3, 2024
3e85022
k9: small changes / enable local mesh
Noki Nov 4, 2024
7ee464d
bilgi: init location
noxilixon Nov 4, 2024
e7c1815
bht: cleanup
FFHener Nov 4, 2024
140763d
vars: define default metrics for babel and move IPv6 prefix definition
spolack Oct 29, 2024
055ae0a
corerouter: Configure bird to run babel protocol
spolack Oct 29, 2024
8fd0c17
corerouter: remove remnants of babeld
spolack Oct 29, 2024
24745e9
network: core-router local mesh bridge config
spolack Oct 30, 2024
9a00225
network: dont require a vid for a core-router local mesh interface
spolack Oct 30, 2024
d7da330
corerouter/bird: fix ifname retrieval for local adhoc interfaces
spolack Oct 30, 2024
64c4354
corerouter/bird: drop verbose logging and include additional configs
spolack Nov 8, 2024
08873f6
imagebuild: configurable compression algorithm for imagebuilder tar
spolack Nov 8, 2024
a855441
Provide feed for OpenWRT 24.10
spolack Nov 8, 2024
d60d755
Netgear WAX220: promote to 24.10
spolack Nov 8, 2024
8437455
bht: change dfs usernames
Noki Nov 9, 2024
bd4fb24
templates: fix whitespace in rclocal
FFHener Nov 10, 2024
7995d21
bht: fix ptp / ptmp setting
Noki Nov 9, 2024
3781df1
bird: metrics penalty for 2.4 GHz adhoch over 5 GHz
Noki Nov 10, 2024
783f78f
Ansible: enable profiler to show timestamps while execution
spolack Nov 10, 2024
d087940
kub: add mesh for ap1
FFHener Nov 4, 2024
e7a5cbd
kub: simplify untagged VLAN
FFHener Nov 4, 2024
0d0b5cd
dragonkiez: /56 subnets for all cores
Noki Nov 14, 2024
7ccaa29
inventory: clean up host_vars leftovers
pktpls Nov 14, 2024
5d903fa
radbahn: remove location
pktpls Nov 14, 2024
7b099fb
hds: remove location
pktpls Nov 14, 2024
66f647c
kirchhof: new AP, switch SSID and Switch
FFHener Nov 4, 2024
9f658ae
tasks (imagebuilder): add comment explaining local imagebuilder
FFHener Nov 15, 2024
483b9fa
tunspace: align tunnel metric with gateways metric
spolack Nov 8, 2024
68812c0
common: rt_tables: fix indentation
spolack Nov 10, 2024
289145d
gateway: create rt_tables containing change for ipv4-via-babel migration
spolack Nov 10, 2024
683dd62
gateway: confire bird to run babel, polish config
spolack Nov 10, 2024
893b24c
gateway: remove entire babeld
spolack Nov 10, 2024
0f6b3d8
Revert "gateway/corerouter: reenable olsrd6 :)"
spolack Nov 10, 2024
2b04139
saarbruecker: fix ipv6_prefix
spolack Nov 10, 2024
2974b3b
location init: pici
ZuquetuPlexis Nov 1, 2024
4392fd8
location init: risi
ZuquetuPlexis Nov 1, 2024
e815586
kitty: init
FFHener Nov 7, 2024
b2db94d
ilr: fix config generation
pktpls Nov 19, 2024
0d99440
ilr: Delete unused interfaces
Akira25 Nov 20, 2024
990e056
ilr: Add static IP-Address to hypervisor
Akira25 Nov 20, 2024
a53f121
corerouter: use patched version of bird2 and add proper inbound metrics
spolack Nov 22, 2024
a58668d
metrics: adjustments and removal of unnecessary settings
Noki Nov 22, 2024
8772471
w38b: next try to fix olsr route flapping
Noki Nov 25, 2024
c904a53
readme: fix typo
ZuquetuPlexis Nov 25, 2024
3afa3e4
zwingli: further adjust metric to avoid sama link
Noki Nov 27, 2024
96e4ad9
treewide: switch debugged hosts from snapshot to 24.10
pktpls Nov 27, 2024
cbc3c65
workflows: add ipv6_subprefix duplicate check
Noki Nov 29, 2024
0197642
w38b: fix ipv6_subprefix duplicate
Noki Nov 29, 2024
1933d57
bht, jup: fix routing
Noki Nov 30, 2024
ce95e91
k12: fix mesh ips and metrics for backup uplink
Noki Nov 30, 2024
fa01e9b
gateways: switch to patched bird2. change metrics:
spolack Nov 29, 2024
25e6b72
gateway: fix BGP bypass in firewall
spolack Nov 29, 2024
6c382d6
gateway: match gre rxcost with default RX cost, to prefer mesh
spolack Dec 1, 2024
fd23b6c
gw/wireguard: increase Tunnel cost to 1024*3 to prefer bbb
spolack Dec 1, 2024
c812623
k12: remove metric lower than default
Noki Dec 2, 2024
e35b3d5
bht, mela: adjust routing metrics
Noki Dec 3, 2024
18f4873
gateway: announce IPv4 default route into babel
spolack Dec 2, 2024
63cdd16
gateways: drop IPv4 Routes learned via GRE
spolack Dec 2, 2024
19aa1ab
Core/Gateway: Babel: add metrics for IPv4
spolack Dec 2, 2024
be08863
gateway: bird: increase preference of static default route
spolack Dec 3, 2024
95ba76f
corerouter: advertise IPv4 via Babel
spolack Dec 3, 2024
81fab4e
w38b: backup uplink, metrics changes
Noki Dec 4, 2024
0623543
gateway/core: install and configure bgpdisco
spolack Dec 3, 2024
74f6181
core/gateway: olsr: change nameservice domain to ff
spolack Dec 3, 2024
a2637ac
core/gateway: drop olsrd6 config
spolack Dec 3, 2024
0c86648
imagebuilder: simplify templating for falter feed url
spolack Nov 14, 2024
593b8f7
version: fix snapshot imagebuilder url
pktpls Nov 14, 2024
70110d6
all: fix dependency on iptables meta package
pktpls Nov 14, 2024
9ed5764
imagebuilder: remove key dir check, it's always present
pktpls Nov 17, 2024
b03df32
imagebuilder: support snapshot APK package feed
pktpls Nov 18, 2024
c395a3d
pktpls: update custom feeds
pktpls Nov 21, 2024
78e971e
model: switch dlink_covr_x1860 to openwrt 24.10
PolynomialDivision Dec 3, 2024
c9679b4
modelfile: cudy wr3000 v1
ZuquetuPlexis Nov 26, 2024
1625f39
scripts: change suffix from .olsr to .ff
Noki Dec 6, 2024
333cc53
elsekiehl, kiehl71, wilde: upgrade to 24.10-SNAPSHOT
pktpls Dec 1, 2024
407eb0e
hacrafu-capelvenere: init
ZuquetuPlexis Aug 4, 2024
61b5719
modelfile: tp-link archer c50 v4
ZuquetuPlexis Aug 4, 2024
ec245a3
imageprofile: fix TLS certificate generation
Noki Dec 8, 2024
f767ebf
ap: prevent lockout when installing firewall later
pktpls Nov 21, 2024
4deb867
simeon: swap core router, cleanup
Noki Dec 9, 2024
1c40424
elsekiehl: remove unused tunspace setup
pktpls Dec 11, 2024
8bd5420
Update sav.yml
Koltonowski Dec 12, 2024
d7c88c1
model: banana bpi r64: bump to openwrt 24.10
PolynomialDivision Dec 13, 2024
2021e31
model: totolink a7000r: bump to openwrt 24.10
PolynomialDivision Dec 13, 2024
e4f6ce8
k9: Update location
Dec 14, 2024
17a7c53
model: Add aruba ap 303
Dec 14, 2024
e00c02b
hacrafu-armarian09: init location
ZuquetuPlexis Aug 27, 2024
53cbb16
model: dlink dap x1860: bump to openwrt 24.10
Noki Dec 14, 2024
f1e61f1
b49: init location
Noki Jul 24, 2024
1beedcc
imagebuild: allow to override build config and configure additional
spolack Dec 10, 2024
5503e4f
imagebuild: allow to append board.d/02_network
spolack Dec 10, 2024
e0e8d8d
model: add protectli vps6630
spolack Dec 10, 2024
67dd83f
saarbruecker-gw: switch to protectli vp6630
spolack Dec 10, 2024
a773551
Revert "imagebuild: allow to append board.d/02_network"
spolack Dec 11, 2024
c3f03c5
saarbruecker-gw: enable naywatch
spolack Dec 15, 2024
d2c73b0
philmel: big cleanup and new devices
FFHener Jul 16, 2024
58b894c
corerouter/ap: dsa: configure vlans as named objects
spolack Dec 16, 2024
cc93ef3
hway: clean up networking
pktpls Dec 9, 2024
7755022
hway: add an outdoor ap
pktpls Dec 9, 2024
e20b9a6
hway: more 24.10 testing
pktpls Dec 9, 2024
645811b
rigaer78: migrate port untagging to using named bridges
Noki Dec 16, 2024
9006ea9
gateways: allow traffic towards inbound_filtered networks
spolack Dec 15, 2024
d5eb13d
gateways: fix olsrd->babel soft migration
spolack Dec 15, 2024
b5fbc2a
baumex: init location
Noki Dec 16, 2024
6ab5200
model: fritzrepeater 1200: add model
freifunkoperator Jul 15, 2024
bbdc0f9
hdk-17: rename parzelle-17 to hdk-17
freifunkoperator Jul 15, 2024
dc259e4
hdk-30: add new location
freifunkoperator Jul 15, 2024
f6087e8
hdk-6: add new location
freifunkoperator Jul 15, 2024
b2df1cd
hdk-15: add new location
freifunkoperator Jul 15, 2024
45fb5b5
give strom v6
nicolasberens Dec 16, 2024
e278976
gateways: create static routes for the gre endpoints
spolack Dec 18, 2024
062ec59
gateway: reorder firewall terms
spolack Dec 19, 2024
363d054
gateway: firewall: default proto to all for custom ipv6 firewall rules
spolack Dec 16, 2024
6c4b7ec
gateway: firewall: increase icmp rate limit into mesh
spolack Dec 19, 2024
b086b7a
gateway: firewall: move bypass term at first position
spolack Dec 19, 2024
315933c
Merge branch 'main' of https://github.com/FBLipke/bbb-configs
LipkeGu Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/checks/check-address-duplicates.sh

This file was deleted.

81 changes: 81 additions & 0 deletions .github/checks/check-duplicates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash

# Locations pattern
location_files="locations/*.yml"

# Initialize a variable to track if any errors are found
error_found=0

# Function to check for duplicates
check_duplicates() {
local yq_query="$1"
local description="$2"
local file_pattern="$3"

# Expand the file pattern to a list of files
# shellcheck disable=SC2206
files=($file_pattern)

# Check if any files match the pattern
if [ ${#files[@]} -eq 0 ]; then
echo "No files matching pattern $file_pattern"
return
fi

# Run the yq command with the expanded list of files
duplicates=$(yq "$yq_query" "${files[@]}" | grep -v -- '---' | tr '[:upper:]' '[:lower:]' | sed 's/["'\'']//g' | sort | uniq -cd)
if [ -n "$duplicates" ]; then
echo "Duplicate $description found:"
echo "$duplicates"
error_found=1
fi
}

# Check for duplicates accross all locations
echo "Checking $location_files"

# Check for hostname duplicates within hosts
check_duplicates 'select(.hosts != null) | .hosts[].hostname' "hostnames within hosts" "$location_files"

# Check for mac_override duplicates within hosts
check_duplicates 'select(.hosts != null) | .hosts[].mac_override | select(. != null) | to_entries[] | .value' "mac_overrides within hosts" "$location_files"

# Check for hostname duplicates within snmp_devices
check_duplicates 'select(.snmp_devices != null) | .snmp_devices[].hostname' "hostnames within snmp_devices" "$location_files"

# Check for address duplicates within snmp_devices
check_duplicates 'select(.snmp_devices != null) | .snmp_devices[].address' "addresses within snmp_devices" "$location_files"

# Check for ipv6_prefix duplicates
check_duplicates 'select(.ipv6_prefix != null) | .ipv6_prefix' "ipv6_prefixes" "$location_files"

# Check for ipv4_prefix duplicates within networks
check_duplicates 'select(.networks != null) | .networks[] | select(.prefix != null) | .prefix' "prefix within networks" "$location_files"

# Check for duplicate hosts within 11a channel assignments
check_duplicates 'select(.location__channel_assignments_11a_standard__to_merge != null) | .location__channel_assignments_11a_standard__to_merge | keys[]' "hosts within 11a channel assignments" "$location_files"

# Check for duplicate hosts within 11g channel assignments
check_duplicates 'select(.location__channel_assignments_11g_standard__to_merge != null) | .location__channel_assignments_11g_standard__to_merge | keys[]' "hosts within 11g channel assignments" "$location_files"

# Check for duplicates within a single location
for file in $location_files; do
echo "Checking $file"

# Check for VID duplicates within networks
check_duplicates 'select(.networks != null) | .networks[] | select(.vid != null) | .vid' "VID within networks" "$file"

# Check for name duplicates within networks
check_duplicates 'select(.networks != null) | .networks[] | select(.name != null) | .name' "name within networks" "$file"

# Check for ipv6_subprefix duplicates within networks
check_duplicates 'select(.networks != null) | .networks[] | select(.ipv6_subprefix != null) | .ipv6_subprefix' "ipv6_subprefix within networks" "$file"

done

# Exit with a non-zero status code if any errors were found
if [ "$error_found" -eq 1 ]; then
exit 1
else
echo "No duplicates found"
fi
29 changes: 0 additions & 29 deletions .github/checks/check-hostname-duplicates.sh

This file was deleted.

47 changes: 47 additions & 0 deletions .github/checks/check-interface-names.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Locations pattern
location_files="locations/*.yml"

# Initialize a variable to track if any errors are found
error_found=0

# Function to check for errors in interface names
check() {
local yq_query="$1"
local file_pattern="$2"

# Expand the file pattern to a list of files
# shellcheck disable=SC2206
files=($file_pattern)

# Check if any files match the pattern
if [ ${#files[@]} -eq 0 ]; then
echo "No files matching pattern $file_pattern"
return
fi

# Run the yq command with the expanded list of files
ifnames=$(yq "$yq_query" "${files[@]}" | grep -v -- '---' | sed 's/["'\'']//g' | sort | uniq)

# Iterate over each interface name and check if it matches the allowed pattern
for ifname in $ifnames; do
if [[ ! "$ifname" =~ ^[a-z0-9_]+$ ]]; then
echo "Error: Interface name does not match allowed pattern [0-9a-z_]: $ifname"
error_found=1
fi
done
}

# Check for issues across locations
echo "Checking $location_files"

# Check for interface name issues
check 'select(.networks != null) | .networks[] | select(.name != null) | .name' "$location_files"

# Exit with a non-zero status code if any errors were found
if [ "$error_found" -eq 1 ]; then
exit 1
else
echo "No errors found"
fi
25 changes: 0 additions & 25 deletions .github/checks/check-ip-prefix-duplicates.sh

This file was deleted.

79 changes: 79 additions & 0 deletions .github/checks/check-mac-override-missing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash

# Initialize a variable to track if any errors are found
error_found=0

# Define patterns for model files
model_files='group_vars/model_*.yml'

# If location files are passed as arguments, override the default location_files variable
if [ "$#" -gt 0 ]; then
# Treat location_files as an array to handle multiple arguments
location_files=("$@")
else
# Use the default pattern if no arguments are passed
location_files=(locations/*.yml)
fi

# If location files are passed as arguments, override the location_files variable
if [ "$#" -gt 0 ]; then
location_files=("$@")
fi

# Find all models that require a mac_override
declare -A mac_override_required_models

for model_file_path in $model_files; do
# Extract model name from file path
model_file=$(basename "$model_file_path" .yml)
model_name=${model_file#model_}

# Check if the model requires mac_override
requires_mac_override=$(yq '.requires_mac_override' "$model_file_path" | tr -d '"')

# Store the result in the associative array
mac_override_required_models["$model_name"]=$requires_mac_override
done

# Find all missing mac_overrides in the provided or all location files
for location_file in "${location_files[@]}"; do
# Check if the file exists (in case only some files were passed in GitHub Action)
if [ ! -f "$location_file" ]; then
echo "File $location_file does not exist, skipping."
continue
fi

# Get hosts as a single YAML block to minimize calls to yq
hosts=$(yq '.hosts' "$location_file")

# Loop through each host entry
for i in $(seq 0 $(($(echo "$hosts" | yq '. | length') - 1))); do
hostname=$(echo "$hosts" | yq ".[$i].hostname" | tr -d '"')
model=$(echo "$hosts" | yq ".[$i].model" | tr -d '"')
mac_override=$(echo "$hosts" | yq ".[$i].mac_override" | tr -d '"')

# Convert model name to match the model file format (underscore instead of hyphen)
model_name=${model//-/_}

# Check if the model requires mac_override using the associative array
requires_mac_override=${mac_override_required_models["$model_name"]}

if [ "$requires_mac_override" = "true" ]; then
if [ "$mac_override" == "null" ]; then
# Output the missing mac_override details immediately
echo "Host $hostname (model: $model) in $location_file is missing mac_override."
error_found=1
fi
fi
done
done

# Exit with a non-zero status code if any errors were found
if [ "$error_found" -eq 1 ]; then
echo "Please look at the model files of the devices missing a mac_override for documentation"
echo "about how to read the mac_address from the device."
exit 1
else
echo "No MAC override issues found."
fi

Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
name: Check for duplicate addresses
name: Check for duplicates

on: [push, pull_request] # yamllint disable-line rule:truthy

jobs:
check-address-duplicates:
check-duplicates:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run address duplicate check
- name: Run check for duplicates
run: |
./.github/checks/check-address-duplicates.sh
yq --version
./.github/checks/check-duplicates.sh
17 changes: 0 additions & 17 deletions .github/workflows/check-hostname-duplicates.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/check-interface-names.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Check interface names

on: [push, pull_request] # yamllint disable-line rule:truthy

jobs:
check-interface-names:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0

# Get a list of changed files and pass them to the script
- name: Get Changed Files and Run interface name check
run: |
# Fetch previous commits for comparison
git fetch origin main

# Get list of changed files compared to main branch
changed_files=$(git diff --name-only origin/main)

# Filter out only the location files from the list of changed files
location_files=$(echo "$changed_files" | grep -E '^locations/.*\.yml$' || true)

if [ -z "$location_files" ]; then
echo "No location files changed, skipping check."
exit 0
fi

# Run the interface name check script with the filtered location files
./.github/checks/check-interface-names.sh "$location_files"
17 changes: 0 additions & 17 deletions .github/workflows/check-ip-prefix-duplicates.yml

This file was deleted.

Loading