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

View file

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

View file

@ -36,61 +36,64 @@ def dhcp(metadata):
'systemd/units', 'systemd/units',
) )
def units(metadata): def units(metadata):
units = {} if node.has_bundle('systemd-networkd'):
units = {}
for network_name, network_conf in metadata.get('network').items(): for network_name, network_conf in metadata.get('network').items():
interface_type = network_conf.get('type', None) interface_type = network_conf.get('type', None)
# network # network
units[f'{network_name}.network'] = { units[f'{network_name}.network'] = {
'Match': { 'Match': {
'Name': network_name if interface_type == 'vlan' else network_conf['interface'], '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',
}, },
'VLAN': { 'Network': {
'Id': network_conf['id'], 'DHCP': network_conf.get('dhcp', 'no'),
'IPv6AcceptRA': network_conf.get('dhcp', 'no'),
'VLAN': set(network_conf.get('vlans', set()))
} }
} }
return { # type
'systemd': {
'units': units, 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': { 'os-prober': {
'installed': False, 'installed': False,
}, },
'dnsmasq-base': {},
}, },
'sources': { 'sources': {
'proxmox-ve': { 'proxmox-ve': {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@
'groups': [ 'groups': [
'autologin', 'autologin',
'backup', 'backup',
'debian-12', 'debian-12-pve',
'home', 'home',
'nextcloud', 'nextcloud',
'monitored', 'monitored',
@ -12,7 +12,6 @@
'build-server', 'build-server',
], ],
'bundles': [ 'bundles': [
'apcupsd',
'build-agent', 'build-agent',
'crystal', 'crystal',
'gitea', 'gitea',
@ -32,7 +31,6 @@
'systemd-swap', 'systemd-swap',
'twitch-clip-download', 'twitch-clip-download',
'raspberrymatic-cert', 'raspberrymatic-cert',
#'tasmota-charge',
'wol-waker', 'wol-waker',
'zfs', 'zfs',
'proxmox-ve', 'proxmox-ve',
@ -156,18 +154,6 @@
}, },
}, },
'systemd-swap': 4_000_000_000, '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': { 'twitch-clip-download': {
'channel_name': 'cronekorkn_', 'channel_name': 'cronekorkn_',
}, },