Compare commits

..

16 commits

Author SHA1 Message Date
6b9b74b1e1
wip 2025-06-29 12:27:09 +02:00
1eafaf0d1c
wip 2025-06-29 12:27:09 +02:00
9159cd1eec
wip 2025-06-29 12:27:09 +02:00
15562df71f
wip 2025-06-29 12:27:09 +02:00
d59802ad92
wip 2025-06-29 12:27:09 +02:00
29ac3d3dd7
wip 2025-06-29 12:27:09 +02:00
76cee836b9
wip 2025-06-29 12:27:09 +02:00
33d6888af4
mailman wip 2025-06-29 12:27:09 +02:00
6e5ce8581b
wip 2025-06-29 12:27:05 +02:00
53933957a4 Merge pull request 'proxmox_mergable' (#22) from proxmox_mergable into master
Reviewed-on: #22
2025-06-29 12:25:34 +02:00
8d941ebef4
open fw for iperf 2025-06-29 12:24:59 +02:00
800bd90778
remove apcupsd 2025-06-29 12:24:59 +02:00
df38fdb99e
new router 2025-06-29 12:24:59 +02:00
23947bd967
mariadb fixed 2025-06-29 12:24:59 +02:00
32ea52c8f4
mariadb use ini parser 2025-06-29 12:24:59 +02:00
d755267dd9
proxmox 2025-06-29 12:24:50 +02:00
12 changed files with 74 additions and 94 deletions

View file

@ -0,0 +1,3 @@
# svc_systemd = {
# 'ifupdown.service': {},
# }

View file

@ -1,11 +0,0 @@
% for section, options in sorted(conf.items()):
[${section}]
% for key, value in sorted(options.items()):
% if value is None:
${key}
% else:
${key} = ${value}
% endif
% endfor
% endfor

View file

@ -10,8 +10,6 @@ directories = {
'group': 'mysql',
'needs': [
'zfs_dataset:tank/mariadb',
],
'needs': [
'pkg_apt:mariadb-server',
'pkg_apt:mariadb-client',
],
@ -20,10 +18,8 @@ directories = {
files = {
'/etc/mysql/conf.d/override.conf': {
'context': {
'conf': node.metadata.get('mariadb/conf'),
},
'content_type': 'mako',
'content': repo.libs.ini.dumps(node.metadata.get('mariadb/conf')),
'content_type': 'text',
},
}

View file

@ -3,12 +3,12 @@ defaults = {
'packages': {
'mariadb-server': {
'needs': {
#'zfs_dataset:tank/mariadb',
'zfs_dataset:tank/mariadb',
},
},
'mariadb-client': {
'needs': {
#'zfs_dataset:tank/mariadb',
'zfs_dataset:tank/mariadb',
},
},
},

View file

@ -36,61 +36,64 @@ def dhcp(metadata):
'systemd/units',
)
def units(metadata):
units = {}
if node.has_bundle('systemd-networkd'):
units = {}
for network_name, network_conf in metadata.get('network').items():
interface_type = network_conf.get('type', None)
for network_name, network_conf in metadata.get('network').items():
interface_type = network_conf.get('type', None)
# network
# network
units[f'{network_name}.network'] = {
'Match': {
'Name': network_name if interface_type == 'vlan' else network_conf['interface'],
},
'Network': {
'DHCP': network_conf.get('dhcp', 'no'),
'IPv6AcceptRA': network_conf.get('dhcp', 'no'),
'VLAN': set(network_conf.get('vlans', set()))
}
}
# type
if interface_type:
units[f'{network_name}.network']['Match']['Type'] = interface_type
# ips
for i in [4, 6]:
if network_conf.get(f'ipv{i}', None):
units[f'{network_name}.network'].update({
f'Address#ipv{i}': {
'Address': network_conf[f'ipv{i}'],
},
})
if f'gateway{i}' in network_conf:
units[f'{network_name}.network'].update({
f'Route#ipv{i}': {
'Gateway': network_conf[f'gateway{i}'],
'GatewayOnlink': 'yes',
}
})
# as vlan
if interface_type == 'vlan':
units[f"{network_name}.netdev"] = {
'NetDev': {
'Name': network_name,
'Kind': 'vlan',
units[f'{network_name}.network'] = {
'Match': {
'Name': network_name if interface_type == 'vlan' else network_conf['interface'],
},
'VLAN': {
'Id': network_conf['id'],
'Network': {
'DHCP': network_conf.get('dhcp', 'no'),
'IPv6AcceptRA': network_conf.get('dhcp', 'no'),
'VLAN': set(network_conf.get('vlans', set()))
}
}
return {
'systemd': {
'units': units,
# type
if interface_type:
units[f'{network_name}.network']['Match']['Type'] = interface_type
# ips
for i in [4, 6]:
if network_conf.get(f'ipv{i}', None):
units[f'{network_name}.network'].update({
f'Address#ipv{i}': {
'Address': network_conf[f'ipv{i}'],
},
})
if f'gateway{i}' in network_conf:
units[f'{network_name}.network'].update({
f'Route#ipv{i}': {
'Gateway': network_conf[f'gateway{i}'],
'GatewayOnlink': 'yes',
}
})
# as vlan
if interface_type == 'vlan':
units[f"{network_name}.netdev"] = {
'NetDev': {
'Name': network_name,
'Kind': 'vlan',
},
'VLAN': {
'Id': network_conf['id'],
}
}
return {
'systemd': {
'units': units,
}
}
}
else:
return {}

View file

@ -13,6 +13,7 @@ defaults = {
'os-prober': {
'installed': False,
},
'dnsmasq-base': {},
},
'sources': {
'proxmox-ve': {

View file

@ -18,9 +18,3 @@ directories = {
svc_systemd = {
'systemd-networkd.service': {},
}
if not node.has_bundle('proxmox-ve'):
files['/etc/network/interfaces'] = {
'delete': True,
}

View file

@ -5,5 +5,6 @@
],
'bundles': [
'ifupdown',
'proxmox-ve',
],
}

View file

@ -47,6 +47,14 @@
'mtr-tiny': {},
},
},
# iperf3
'nftables': {
'input': {
'tcp dport 5201 accept',
'udp dport 5201 accept',
},
},
},
'os': 'debian',
'pip_command': 'pip3',

View file

@ -14,7 +14,7 @@ class CaseSensitiveConfigParser(ConfigParser):
return value
def parse(text):
config = CaseSensitiveConfigParser()
config = CaseSensitiveConfigParser(allow_no_value=True)
config.read_string(text)
return {
@ -24,8 +24,7 @@ def parse(text):
def dumps(dict):
sorted_dict = json.loads(json.dumps(dict, sort_keys=True, cls=MetadataJSONEncoder))
parser = CaseSensitiveConfigParser()
parser = CaseSensitiveConfigParser(allow_no_value=True)
parser.read_dict(sorted_dict)
writable = Writable()

View file

@ -15,7 +15,7 @@
'id': '1d6a43e5-858c-42f9-9c40-ab63d61c787c',
'network': {
'external': {
'interface': 'enx00e04c220682',
'interface': 'enp2s0',
'ipv4': '10.0.99.126/24',
'gateway4': '10.0.99.1',
'vlans': {'iot', 'internet', 'guest', 'rolf', 'internal', 'proxmox'},

View file

@ -3,7 +3,7 @@
'groups': [
'autologin',
'backup',
'debian-12',
'debian-12-pve',
'home',
'nextcloud',
'monitored',
@ -12,7 +12,6 @@
'build-server',
],
'bundles': [
'apcupsd',
'build-agent',
'crystal',
'gitea',
@ -32,7 +31,6 @@
'systemd-swap',
'twitch-clip-download',
'raspberrymatic-cert',
#'tasmota-charge',
'wol-waker',
'zfs',
'proxmox-ve',
@ -156,18 +154,6 @@
},
},
'systemd-swap': 4_000_000_000,
'tasmota-charge': {
'phone': {
'ip': '10.0.0.175',
'user': 'u0_a233',
'password': 'november',
},
'plug': {
'ip': '10.0.2.115',
'min': 45,
'max': 70,
},
},
'twitch-clip-download': {
'channel_name': 'cronekorkn_',
},