From 0e6a705d3f09f5782af17172680051e178a6f998 Mon Sep 17 00:00:00 2001 From: CroneKorkN Date: Tue, 1 Jul 2025 07:41:04 +0200 Subject: [PATCH] routeros switches ok --- bundles/proxmox-ve/items.py | 2 +- bundles/routeros/items.py | 5 +- groups/os/routeros.py | 5 -- nodes/home.server.py | 7 ++- nodes/home.switch-rack-10g.py | 36 ++++++++++++ nodes/home.switch-vorratsraum-poe.py | 86 ++++++++++++++++++++++++++++ nodes/home.switch-wohnzimmer-10g.py | 6 +- 7 files changed, 138 insertions(+), 9 deletions(-) diff --git a/bundles/proxmox-ve/items.py b/bundles/proxmox-ve/items.py index d00540f..7be208c 100644 --- a/bundles/proxmox-ve/items.py +++ b/bundles/proxmox-ve/items.py @@ -9,7 +9,7 @@ files = { }, '/etc/apt/apt.conf.d/76pveproxy': { 'content_type': 'any', - 'mode': '0444', + 'mode': '0644', }, '/etc/network/interfaces': { 'content_type': 'any', diff --git a/bundles/routeros/items.py b/bundles/routeros/items.py index b9c3ef1..eb2e279 100644 --- a/bundles/routeros/items.py +++ b/bundles/routeros/items.py @@ -67,7 +67,9 @@ for vlan_name, vlan_id in node.metadata.get('routeros/vlans').items(): 'untagged': sorted(node.metadata.get(f'routeros/vlan_ports/{vlan_name}/untagged')), 'tagged': sorted(node.metadata.get(f'routeros/vlan_ports/{vlan_name}/tagged')), '_comment': vlan_name, - 'tags': {'routeros-bridge-vlan'}, + 'tags': { + 'routeros-vlan-ports', + }, 'needs': { #'routeros:/interface/bridge?name=bridge', 'tag:routeros-vlan', @@ -93,6 +95,7 @@ routeros['/interface/bridge?name=bridge'] = { 'protocol-mode': 'rstp', 'needs': { 'tag:routeros-vlan', + 'tag:routeros-vlan-ports', 'tag:routeros-ip', }, } diff --git a/groups/os/routeros.py b/groups/os/routeros.py index c037f73..87b7035 100644 --- a/groups/os/routeros.py +++ b/groups/os/routeros.py @@ -34,11 +34,6 @@ }, }, 'vlan_ports': {}, - 'ips': { - '10.0.0.62/24': { - 'interface': 'home', - }, - }, }, }, 'os': 'routeros', diff --git a/nodes/home.server.py b/nodes/home.server.py index 4b30c61..23076ee 100644 --- a/nodes/home.server.py +++ b/nodes/home.server.py @@ -38,10 +38,15 @@ 'id': 'af96709e-b13f-4965-a588-ef2cd476437a', 'network': { 'internal': { - 'interface': 'enp42s0', + 'interface': 'enp43s0', 'ipv4': '10.0.0.2/24', 'gateway4': '10.0.0.1', }, + 'old-internal': { + 'interface': 'enp42s0', + 'ipv4': '10.0.0.82/24', + 'gateway4': '10.0.0.1', + }, }, 'apt': { 'packages': { diff --git a/nodes/home.switch-rack-10g.py b/nodes/home.switch-rack-10g.py index a5e7cdb..968b62a 100644 --- a/nodes/home.switch-rack-10g.py +++ b/nodes/home.switch-rack-10g.py @@ -6,5 +6,41 @@ ], 'metadata': { 'id': '26eca3f1-975e-426f-bd7d-e2a1ef36519e', + 'routeros': { + 'ips': { + '10.0.0.63/24': { + 'interface': 'home', + }, + }, + 'ports': { + 'sfp-sfpplus1': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus2': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus3': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus4': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus5': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus6': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus7': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus8': { + 'vlan_group': 'infra', + }, + 'ether1': { + 'vlan_group': 'infra', + }, + }, + }, }, } diff --git a/nodes/home.switch-vorratsraum-poe.py b/nodes/home.switch-vorratsraum-poe.py index 6eb1efe..346de17 100644 --- a/nodes/home.switch-vorratsraum-poe.py +++ b/nodes/home.switch-vorratsraum-poe.py @@ -7,10 +7,96 @@ 'metadata': { 'id': 'e6a24df7-eed1-404e-af78-15ebcbcc02a2', 'routeros': { + 'ips': { + '10.0.0.60/24': { + 'interface': 'home', + }, + }, 'ports': { + 'sfp-sfpplus1': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus2': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus3': { + 'vlan_group': 'infra', + }, + 'sfp-sfpplus4': { + 'vlan_group': 'infra', + }, 'ether1': { 'vlan_group': 'infra', }, + 'ether2': { + 'vlan_group': 'infra', + }, + 'ether3': { + 'vlan_group': 'infra', + }, + 'ether4': { + 'vlan_group': 'infra', + }, + 'ether5': { + 'vlan_group': 'infra', + }, + 'ether6': { + 'vlan_group': 'infra', + }, + 'ether7': { + 'vlan_group': 'infra', + }, + 'ether8': { + 'vlan_group': 'infra', + }, + 'ether9': { + 'vlan_group': 'infra', + }, + 'ether10': { + 'vlan_group': 'infra', + }, + 'ether11': { + 'vlan_group': 'infra', + }, + 'ether12': { + 'vlan_group': 'infra', + }, + 'ether13': { + 'vlan_group': 'infra', + }, + 'ether14': { + 'vlan_group': 'infra', + }, + 'ether15': { + 'vlan_group': 'infra', + }, + 'ether16': { + 'vlan_group': 'infra', + }, + 'ether17': { + 'vlan_group': 'infra', + }, + 'ether18': { + 'vlan_group': 'infra', + }, + 'ether19': { + 'vlan_group': 'infra', + }, + 'ether20': { + 'vlan_group': 'infra', + }, + 'ether21': { + 'vlan_group': 'infra', + }, + 'ether22': { + 'vlan_group': 'infra', + }, + 'ether23': { + 'vlan_group': 'infra', + }, + 'ether24': { + 'vlan_group': 'infra', + }, }, }, }, diff --git a/nodes/home.switch-wohnzimmer-10g.py b/nodes/home.switch-wohnzimmer-10g.py index 3da9d95..e90b213 100644 --- a/nodes/home.switch-wohnzimmer-10g.py +++ b/nodes/home.switch-wohnzimmer-10g.py @@ -1,5 +1,4 @@ { - #'hostname': '192.168.88.1', 'hostname': '10.0.0.62', 'password': '!decrypt:encrypt$gAAAAABoYFSyt2JAsdePXiHim1RdQwbarJedhAOE3XpS2rGMBx-F5eCWRCIyLU2g2ocUDUIDfgH3nBipUCkdcd0Bv4vbK-yqKmGSeSH7YXLYwq3ZWuCDsLM=', 'groups': [ @@ -8,6 +7,11 @@ 'metadata': { 'id': 'e6a24df7-eed1-404e-af78-15ebcbcc02a2', 'routeros': { + 'ips': { + '10.0.0.62/24': { + 'interface': 'home', + }, + }, 'ports': { 'ether1': { 'vlan_group': 'infra',