vlan interface in vlan netwrok, not in seperate list

This commit is contained in:
CroneKorkN 2025-07-01 12:20:39 +02:00
parent 7ab96e6a47
commit db56385513
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw
3 changed files with 11 additions and 2 deletions

View file

@ -3,6 +3,7 @@ from json import dumps
h = repo.libs.hashable.hashable h = repo.libs.hashable.hashable
repo.libs.bind.repo = repo repo.libs.bind.repo = repo
defaults = { defaults = {
'apt': { 'apt': {
'packages': { 'packages': {

View file

@ -51,7 +51,11 @@ def units(metadata):
'Network': { 'Network': {
'DHCP': network_conf.get('dhcp', 'no'), 'DHCP': network_conf.get('dhcp', 'no'),
'IPv6AcceptRA': network_conf.get('dhcp', 'no'), 'IPv6AcceptRA': network_conf.get('dhcp', 'no'),
'VLAN': set(network_conf.get('vlans', set())) 'VLAN': set(
other_network_name
for other_network_name, other_network_conf in metadata.get('network', {}).items()
if other_network_conf.get('type') == 'vlan' and other_network_conf['vlan_interface'] == network_name
)
} }
} }

View file

@ -18,35 +18,39 @@
'internal': { 'internal': {
'interface': 'enp1s0f0', 'interface': 'enp1s0f0',
'ipv4': '10.0.0.1/24', 'ipv4': '10.0.0.1/24',
'vlans': {'iot', 'internet', 'guest', 'rolf', 'proxmox'},
'dhcp_server': True, 'dhcp_server': True,
}, },
'iot': { 'iot': {
'type': 'vlan', 'type': 'vlan',
'vlan_interface': 'internal',
'id': 2, 'id': 2,
'ipv4': '10.0.2.1/24', 'ipv4': '10.0.2.1/24',
'dhcp_server': True, 'dhcp_server': True,
}, },
'external': { 'external': {
'type': 'vlan', 'type': 'vlan',
'vlan_interface': 'internal',
'id': 3, 'id': 3,
'ipv4': '10.0.99.126/24', 'ipv4': '10.0.99.126/24',
'gateway4': '10.0.99.1', 'gateway4': '10.0.99.1',
}, },
'proxmox': { 'proxmox': {
'type': 'vlan', 'type': 'vlan',
'vlan_interface': 'internal',
'id': 4, 'id': 4,
'ipv4': '10.0.4.1/24', 'ipv4': '10.0.4.1/24',
'dhcp_server': True, 'dhcp_server': True,
}, },
'guest': { 'guest': {
'type': 'vlan', 'type': 'vlan',
'vlan_interface': 'internal',
'id': 9, 'id': 9,
'ipv4': '10.0.9.1/24', 'ipv4': '10.0.9.1/24',
'dhcp_server': True, 'dhcp_server': True,
}, },
'rolf': { # rolf local test 'rolf': { # rolf local test
'type': 'vlan', 'type': 'vlan',
'vlan_interface': 'internal',
'id': 51, 'id': 51,
'ipv4': '192.168.179.1/24', 'ipv4': '192.168.179.1/24',
'dhcp_server': True, 'dhcp_server': True,