proxmox_mergable #22
18 changed files with 246 additions and 92 deletions
3
bundles/ifupdown/items.py
Normal file
3
bundles/ifupdown/items.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# svc_systemd = {
|
||||||
|
# 'ifupdown.service': {},
|
||||||
|
# }
|
|
@ -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
|
|
|
@ -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',
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -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 {}
|
||||||
|
|
21
bundles/proxmox-ve/items.py
Normal file
21
bundles/proxmox-ve/items.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
files = {
|
||||||
|
'/etc/apt/apt.conf.d/10pveapthook': {
|
||||||
|
'content_type': 'any',
|
||||||
|
'mode': '0644',
|
||||||
|
},
|
||||||
|
'/etc/apt/apt.conf.d/76pveconf': {
|
||||||
|
'content_type': 'any',
|
||||||
|
'mode': '0444',
|
||||||
|
},
|
||||||
|
'/etc/apt/apt.conf.d/76pveproxy': {
|
||||||
|
'content_type': 'any',
|
||||||
|
'mode': '0444',
|
||||||
|
},
|
||||||
|
'/etc/network/interfaces': {
|
||||||
|
'content_type': 'any',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
symlinks['/etc/ssh/ssh_host_rsa_key.pub'] = {
|
||||||
|
'target': '/etc/ssh/ssh_host_managed_key.pub',
|
||||||
|
}
|
99
bundles/proxmox-ve/metadata.py
Normal file
99
bundles/proxmox-ve/metadata.py
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
defaults = {
|
||||||
|
'apt': {
|
||||||
|
'packages': {
|
||||||
|
'linux-image-amd64': {
|
||||||
|
'installed': False,
|
||||||
|
},
|
||||||
|
'proxmox-default-kernel': {},
|
||||||
|
# after reboot
|
||||||
|
'proxmox-ve': {},
|
||||||
|
'postfix': {},
|
||||||
|
'open-iscsi': {},
|
||||||
|
'chrony': {},
|
||||||
|
'os-prober': {
|
||||||
|
'installed': False,
|
||||||
|
},
|
||||||
|
'dnsmasq-base': {},
|
||||||
|
},
|
||||||
|
'sources': {
|
||||||
|
'proxmox-ve': {
|
||||||
|
'options': {
|
||||||
|
'aarch': 'amd64',
|
||||||
|
},
|
||||||
|
'urls': {
|
||||||
|
'http://download.proxmox.com/debian/pve',
|
||||||
|
},
|
||||||
|
'suites': {
|
||||||
|
'{codename}',
|
||||||
|
},
|
||||||
|
'components': {
|
||||||
|
'pve-no-subscription',
|
||||||
|
},
|
||||||
|
'key': 'proxmox-ve-{codename}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
# 'nftables': {
|
||||||
|
# 'input': {
|
||||||
|
# 'tcp dport 8006 accept',
|
||||||
|
# },
|
||||||
|
# },
|
||||||
|
'zfs': {
|
||||||
|
'datasets': {
|
||||||
|
'tank/proxmox-ve': {
|
||||||
|
'mountpoint': '/var/lib/proxmox-ve',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# @metadata_reactor.provides(
|
||||||
|
# 'systemd',
|
||||||
|
# )
|
||||||
|
# def bridge(metadata):
|
||||||
|
# return {
|
||||||
|
# 'systemd': {
|
||||||
|
# 'units': {
|
||||||
|
# # f'internal.network': {
|
||||||
|
# # 'Network': {
|
||||||
|
# # 'Bridge': 'br0',
|
||||||
|
# # },
|
||||||
|
# # },
|
||||||
|
# 'br0.netdev': {
|
||||||
|
# 'NetDev': {
|
||||||
|
# 'Name': 'br0',
|
||||||
|
# 'Kind': 'bridge'
|
||||||
|
# },
|
||||||
|
# },
|
||||||
|
# 'br0.network': {
|
||||||
|
# 'Match': {
|
||||||
|
# 'Name': 'br0',
|
||||||
|
# },
|
||||||
|
# 'Network': {
|
||||||
|
# 'Unmanaged': 'yes'
|
||||||
|
# },
|
||||||
|
# },
|
||||||
|
# },
|
||||||
|
# },
|
||||||
|
# }
|
||||||
|
|
||||||
|
|
||||||
|
@metadata_reactor.provides(
|
||||||
|
'nginx/vhosts',
|
||||||
|
)
|
||||||
|
def nginx(metadata):
|
||||||
|
return {
|
||||||
|
'nginx': {
|
||||||
|
'has_websockets': True,
|
||||||
|
'vhosts': {
|
||||||
|
metadata.get('proxmox-ve/domain'): {
|
||||||
|
'content': 'nginx/proxy_pass.conf',
|
||||||
|
'context': {
|
||||||
|
'target': 'https://localhost:8006',
|
||||||
|
'websockets': True,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -21,4 +21,3 @@ directories = {
|
||||||
svc_systemd = {
|
svc_systemd = {
|
||||||
'systemd-networkd.service': {},
|
'systemd-networkd.service': {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
data/apt/keys/proxmox-ve-bookworm.gpg
Normal file
BIN
data/apt/keys/proxmox-ve-bookworm.gpg
Normal file
Binary file not shown.
|
@ -2,6 +2,9 @@
|
||||||
'supergroups': [
|
'supergroups': [
|
||||||
'debian',
|
'debian',
|
||||||
],
|
],
|
||||||
|
'bundles': [
|
||||||
|
'systemd-networkd',
|
||||||
|
],
|
||||||
'metadata': {
|
'metadata': {
|
||||||
'php': {
|
'php': {
|
||||||
'version': '7.4',
|
'version': '7.4',
|
||||||
|
|
26
groups/os/debian-12-common.py
Normal file
26
groups/os/debian-12-common.py
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
'metadata': {
|
||||||
|
'apt': {
|
||||||
|
'sources': {
|
||||||
|
'debian': {
|
||||||
|
'components': {
|
||||||
|
'non-free-firmware',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'debian-security': {
|
||||||
|
'components': {
|
||||||
|
'non-free-firmware',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'php': {
|
||||||
|
'version': '8.2',
|
||||||
|
},
|
||||||
|
'postgresql': {
|
||||||
|
'version': '15',
|
||||||
|
},
|
||||||
|
'os_codename': 'bookworm',
|
||||||
|
},
|
||||||
|
'os_version': (12,),
|
||||||
|
}
|
10
groups/os/debian-12-pve.py
Normal file
10
groups/os/debian-12-pve.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
'supergroups': [
|
||||||
|
'debian',
|
||||||
|
'debian-12-common',
|
||||||
|
],
|
||||||
|
'bundles': [
|
||||||
|
'ifupdown',
|
||||||
|
'proxmox-ve',
|
||||||
|
],
|
||||||
|
}
|
|
@ -1,6 +1,10 @@
|
||||||
{
|
{
|
||||||
'supergroups': [
|
'supergroups': [
|
||||||
'debian',
|
'debian',
|
||||||
|
'debian-12-common',
|
||||||
|
],
|
||||||
|
'bundles': [
|
||||||
|
'systemd-networkd',
|
||||||
],
|
],
|
||||||
'metadata': {
|
'metadata': {
|
||||||
'apt': {
|
'apt': {
|
||||||
|
|
|
@ -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',
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
'system',
|
'system',
|
||||||
'systemd',
|
'systemd',
|
||||||
'systemd-journald',
|
'systemd-journald',
|
||||||
'systemd-networkd',
|
|
||||||
'systemd-mount',
|
'systemd-mount',
|
||||||
'systemd-timers',
|
'systemd-timers',
|
||||||
'users',
|
'users',
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
'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'},
|
'vlans': {'iot', 'internet', 'guest', 'rolf', 'internal', 'proxmox'},
|
||||||
},
|
},
|
||||||
'internal': {
|
'internal': {
|
||||||
'type': 'vlan',
|
'type': 'vlan',
|
||||||
|
@ -37,6 +37,12 @@
|
||||||
'id': 3,
|
'id': 3,
|
||||||
'ipv4': '10.0.3.1/24',
|
'ipv4': '10.0.3.1/24',
|
||||||
},
|
},
|
||||||
|
'proxmox': {
|
||||||
|
'type': 'vlan',
|
||||||
|
'id': 4,
|
||||||
|
'ipv4': '10.0.4.1/24',
|
||||||
|
'dhcp_server': True,
|
||||||
|
},
|
||||||
'guest': {
|
'guest': {
|
||||||
'type': 'vlan',
|
'type': 'vlan',
|
||||||
'id': 9,
|
'id': 9,
|
||||||
|
|
|
@ -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',
|
||||||
],
|
],
|
||||||
|
@ -47,7 +45,7 @@
|
||||||
},
|
},
|
||||||
'apt': {
|
'apt': {
|
||||||
'packages': {
|
'packages': {
|
||||||
'firmware-realtek': {},
|
# 'firmware-realtek': {}, proxmox-ve incompatibility
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'build-server': {
|
'build-server': {
|
||||||
|
@ -124,6 +122,9 @@
|
||||||
'unsortable': 'SofortUpload/Unsortable',
|
'unsortable': 'SofortUpload/Unsortable',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'proxmox-ve': {
|
||||||
|
'domain': 'pve.ckn.li',
|
||||||
|
},
|
||||||
'raspberrymatic-cert': {
|
'raspberrymatic-cert': {
|
||||||
'domain': 'homematic.ckn.li',
|
'domain': 'homematic.ckn.li',
|
||||||
'node': 'home.homematic',
|
'node': 'home.homematic',
|
||||||
|
@ -152,18 +153,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_',
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue