Compare commits
9 commits
6b9b74b1e1
...
5959d896e0
Author | SHA1 | Date | |
---|---|---|---|
5959d896e0 | |||
171ca93fbb | |||
996a6d1ceb | |||
2bcdeb372e | |||
782b11d9d1 | |||
d423cb3531 | |||
e71b5159ed | |||
a461aca4c4 | |||
7350b01403 |
12 changed files with 97 additions and 77 deletions
|
@ -1,3 +0,0 @@
|
|||
# svc_systemd = {
|
||||
# 'ifupdown.service': {},
|
||||
# }
|
11
bundles/mariadb/files/override.conf
Normal file
11
bundles/mariadb/files/override.conf
Normal file
|
@ -0,0 +1,11 @@
|
|||
% 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,6 +10,8 @@ directories = {
|
|||
'group': 'mysql',
|
||||
'needs': [
|
||||
'zfs_dataset:tank/mariadb',
|
||||
],
|
||||
'needs': [
|
||||
'pkg_apt:mariadb-server',
|
||||
'pkg_apt:mariadb-client',
|
||||
],
|
||||
|
@ -18,8 +20,10 @@ directories = {
|
|||
|
||||
files = {
|
||||
'/etc/mysql/conf.d/override.conf': {
|
||||
'content': repo.libs.ini.dumps(node.metadata.get('mariadb/conf')),
|
||||
'content_type': 'text',
|
||||
'context': {
|
||||
'conf': node.metadata.get('mariadb/conf'),
|
||||
},
|
||||
'content_type': 'mako',
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -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',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -36,64 +36,61 @@ def dhcp(metadata):
|
|||
'systemd/units',
|
||||
)
|
||||
def units(metadata):
|
||||
if node.has_bundle('systemd-networkd'):
|
||||
units = {}
|
||||
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',
|
||||
},
|
||||
'VLAN': {
|
||||
'Id': network_conf['id'],
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
'systemd': {
|
||||
'units': units,
|
||||
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()))
|
||||
}
|
||||
}
|
||||
else:
|
||||
return {}
|
||||
|
||||
# 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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ defaults = {
|
|||
'os-prober': {
|
||||
'installed': False,
|
||||
},
|
||||
'dnsmasq-base': {},
|
||||
},
|
||||
'sources': {
|
||||
'proxmox-ve': {
|
||||
|
|
|
@ -18,3 +18,9 @@ directories = {
|
|||
svc_systemd = {
|
||||
'systemd-networkd.service': {},
|
||||
}
|
||||
|
||||
|
||||
if not node.has_bundle('proxmox-ve'):
|
||||
files['/etc/network/interfaces'] = {
|
||||
'delete': True,
|
||||
}
|
||||
|
|
|
@ -5,6 +5,5 @@
|
|||
],
|
||||
'bundles': [
|
||||
'ifupdown',
|
||||
'proxmox-ve',
|
||||
],
|
||||
}
|
||||
|
|
|
@ -47,14 +47,6 @@
|
|||
'mtr-tiny': {},
|
||||
},
|
||||
},
|
||||
# iperf3
|
||||
'nftables': {
|
||||
'input': {
|
||||
'tcp dport 5201 accept',
|
||||
'udp dport 5201 accept',
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
'os': 'debian',
|
||||
'pip_command': 'pip3',
|
||||
|
|
|
@ -14,7 +14,7 @@ class CaseSensitiveConfigParser(ConfigParser):
|
|||
return value
|
||||
|
||||
def parse(text):
|
||||
config = CaseSensitiveConfigParser(allow_no_value=True)
|
||||
config = CaseSensitiveConfigParser()
|
||||
config.read_string(text)
|
||||
|
||||
return {
|
||||
|
@ -24,7 +24,8 @@ def parse(text):
|
|||
|
||||
def dumps(dict):
|
||||
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)
|
||||
|
||||
writable = Writable()
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
'id': '1d6a43e5-858c-42f9-9c40-ab63d61c787c',
|
||||
'network': {
|
||||
'external': {
|
||||
'interface': 'enp2s0',
|
||||
'interface': 'enx00e04c220682',
|
||||
'ipv4': '10.0.99.126/24',
|
||||
'gateway4': '10.0.99.1',
|
||||
'vlans': {'iot', 'internet', 'guest', 'rolf', 'internal', 'proxmox'},
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
'groups': [
|
||||
'autologin',
|
||||
'backup',
|
||||
'debian-12-pve',
|
||||
'debian-12',
|
||||
'home',
|
||||
'nextcloud',
|
||||
'monitored',
|
||||
|
@ -12,6 +12,7 @@
|
|||
'build-server',
|
||||
],
|
||||
'bundles': [
|
||||
'apcupsd',
|
||||
'build-agent',
|
||||
'crystal',
|
||||
'gitea',
|
||||
|
@ -31,6 +32,7 @@
|
|||
'systemd-swap',
|
||||
'twitch-clip-download',
|
||||
'raspberrymatic-cert',
|
||||
#'tasmota-charge',
|
||||
'wol-waker',
|
||||
'zfs',
|
||||
'proxmox-ve',
|
||||
|
@ -154,6 +156,18 @@
|
|||
},
|
||||
},
|
||||
'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_',
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue