left4dead: only individual server workshop downloads
This commit is contained in:
parent
9f8a64a653
commit
801a8bcf5f
7 changed files with 48 additions and 77 deletions
|
@ -1,19 +1,6 @@
|
||||||
assert node.has_bundle('steam') and node.has_bundle('steam-workshop-download')
|
assert node.has_bundle('steam') and node.has_bundle('steam-workshop-download')
|
||||||
|
|
||||||
directories = {
|
directories = {
|
||||||
'/opt/steam/left4dead2/left4dead2/ems/admin system': {
|
|
||||||
'owner': 'steam',
|
|
||||||
'group': 'steam',
|
|
||||||
'mode': '0755',
|
|
||||||
},
|
|
||||||
'/opt/steam/left4dead2/left4dead2/addons': {
|
|
||||||
'owner': 'steam',
|
|
||||||
'group': 'steam',
|
|
||||||
'purge': True,
|
|
||||||
'triggers': [
|
|
||||||
*[f'svc_systemd:left4dead2-{name}.service:restart' for name in node.metadata.get('left4dead2/servers')],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
'/opt/steam/left4dead2-servers': {
|
'/opt/steam/left4dead2-servers': {
|
||||||
'owner': 'steam',
|
'owner': 'steam',
|
||||||
'group': 'steam',
|
'group': 'steam',
|
||||||
|
@ -30,30 +17,6 @@ directories = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
files = {
|
|
||||||
'/opt/steam/left4dead2/left4dead2/ems/admin system/admins.txt': {
|
|
||||||
'owner': 'steam',
|
|
||||||
'group': 'steam',
|
|
||||||
'mode': '0755',
|
|
||||||
'content': '\n'.join(sorted(node.metadata.get('left4dead2/admins'))),
|
|
||||||
},
|
|
||||||
'/opt/steam/left4dead2/left4dead2/addons/readme.txt': {
|
|
||||||
'content_type': 'any',
|
|
||||||
'owner': 'steam',
|
|
||||||
'group': 'steam',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for id in node.metadata.get('left4dead2/workshop'):
|
|
||||||
files[f'/opt/steam/left4dead2/left4dead2/addons/{id}.vpk'] = {
|
|
||||||
'content_type': 'any',
|
|
||||||
'owner': 'steam',
|
|
||||||
'group': 'steam',
|
|
||||||
'triggers': [
|
|
||||||
*[f'svc_systemd:left4dead2-{name}.service:restart' for name in node.metadata.get('left4dead2/servers')],
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
# /opt/steam/steam/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory
|
# /opt/steam/steam/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory
|
||||||
symlinks = {
|
symlinks = {
|
||||||
'/opt/steam/steam/.steam/sdk32': {
|
'/opt/steam/steam/.steam/sdk32': {
|
||||||
|
@ -99,7 +62,24 @@ for name, config in node.metadata.get('left4dead2/servers').items():
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
# addons
|
# service
|
||||||
|
svc_systemd[f'left4dead2-{name}.service'] = {
|
||||||
|
'needs': [
|
||||||
|
f'file:/opt/steam/left4dead2-servers/{name}/left4dead2/cfg/server.cfg',
|
||||||
|
f'file:/usr/local/lib/systemd/system/left4dead2-{name}.service',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# ADDONS
|
||||||
|
#
|
||||||
|
|
||||||
|
# base
|
||||||
|
files[f'/opt/steam/left4dead2-servers/{name}/left4dead2/addons/readme.txt'] = {
|
||||||
|
'content_type': 'any',
|
||||||
|
'owner': 'steam',
|
||||||
|
'group': 'steam',
|
||||||
|
}
|
||||||
directories[f'/opt/steam/left4dead2-servers/{name}/left4dead2/addons'] = {
|
directories[f'/opt/steam/left4dead2-servers/{name}/left4dead2/addons'] = {
|
||||||
'owner': 'steam',
|
'owner': 'steam',
|
||||||
'group': 'steam',
|
'group': 'steam',
|
||||||
|
@ -108,11 +88,6 @@ for name, config in node.metadata.get('left4dead2/servers').items():
|
||||||
f'svc_systemd:left4dead2-{name}.service:restart',
|
f'svc_systemd:left4dead2-{name}.service:restart',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
files[f'/opt/steam/left4dead2-servers/{name}/left4dead2/addons/readme.txt'] = {
|
|
||||||
'content_type': 'any',
|
|
||||||
'owner': 'steam',
|
|
||||||
'group': 'steam',
|
|
||||||
}
|
|
||||||
for id in [
|
for id in [
|
||||||
*config.get('workshop', []),
|
*config.get('workshop', []),
|
||||||
*node.metadata.get('left4dead2/workshop'),
|
*node.metadata.get('left4dead2/workshop'),
|
||||||
|
@ -126,10 +101,22 @@ for name, config in node.metadata.get('left4dead2/servers').items():
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
# service
|
# admin system
|
||||||
svc_systemd[f'left4dead2-{name}.service'] = {
|
|
||||||
'needs': [
|
directories[f'/opt/steam/left4dead2-servers/{name}/left4dead2/ems/admin system'] = {
|
||||||
f'file:/opt/steam/left4dead2-servers/{name}/left4dead2/cfg/server.cfg',
|
'owner': 'steam',
|
||||||
f'file:/usr/local/lib/systemd/system/left4dead2-{name}.service',
|
'group': 'steam',
|
||||||
|
'mode': '0755',
|
||||||
|
'triggers': [
|
||||||
|
f'svc_systemd:left4dead2-{name}.service:restart',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
files[f'/opt/steam/left4dead2-servers/{name}/left4dead2/ems/admin system/admins.txt'] = {
|
||||||
|
'owner': 'steam',
|
||||||
|
'group': 'steam',
|
||||||
|
'mode': '0755',
|
||||||
|
'content': '\n'.join(sorted(node.metadata.get('left4dead2/admins'))),
|
||||||
|
'triggers': [
|
||||||
|
f'svc_systemd:left4dead2-{name}.service:restart',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,31 +33,6 @@ def rconn_password(metadata):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
|
||||||
'steam-workshop-download',
|
|
||||||
)
|
|
||||||
def workshop_download(metadata):
|
|
||||||
if metadata.get('left4dead2/workshop'):
|
|
||||||
return {
|
|
||||||
'steam-workshop-download': {
|
|
||||||
'left4dead2-global': {
|
|
||||||
'ids': metadata.get('left4dead2/workshop'),
|
|
||||||
'path': '/opt/steam/left4dead2/left4dead2/addons',
|
|
||||||
'user': 'steam',
|
|
||||||
'requires': {
|
|
||||||
'steam-update.service',
|
|
||||||
},
|
|
||||||
'required_by': {
|
|
||||||
f'left4dead2-{name}.service'
|
|
||||||
for name in metadata.get('left4dead2/servers')
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
return {}
|
|
||||||
|
|
||||||
|
|
||||||
@metadata_reactor.provides(
|
@metadata_reactor.provides(
|
||||||
'steam-workshop-download',
|
'steam-workshop-download',
|
||||||
'systemd/units',
|
'systemd/units',
|
||||||
|
@ -95,9 +70,10 @@ def server_units(metadata):
|
||||||
}
|
}
|
||||||
|
|
||||||
# individual workshop
|
# individual workshop
|
||||||
if 'workshop' in config:
|
workshop_ids = config.get('workshop', set()) | metadata.get('left4dead2/workshop', set())
|
||||||
|
if workshop_ids:
|
||||||
workshop[f'left4dead2-{name}'] = {
|
workshop[f'left4dead2-{name}'] = {
|
||||||
'ids': config['workshop'],
|
'ids': workshop_ids,
|
||||||
'path': f'/opt/steam/left4dead2-servers/{name}/left4dead2/addons',
|
'path': f'/opt/steam/left4dead2-servers/{name}/left4dead2/addons',
|
||||||
'user': 'steam',
|
'user': 'steam',
|
||||||
'requires': {
|
'requires': {
|
||||||
|
|
1
bundles/pip/items.py
Normal file
1
bundles/pip/items.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
pkg_pip = node.metadata.get('pip')
|
3
bundles/pip/metadata.py
Normal file
3
bundles/pip/metadata.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
defaults = {
|
||||||
|
'pip': {},
|
||||||
|
}
|
|
@ -3,6 +3,9 @@ from shlex import quote
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
'steam-workshop-download': {},
|
'steam-workshop-download': {},
|
||||||
|
'pip': {
|
||||||
|
'vpk': {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ actions = {
|
||||||
}
|
}
|
||||||
|
|
||||||
svc_systemd['steam-update.service'] = {
|
svc_systemd['steam-update.service'] = {
|
||||||
'running': False,
|
'running': None,
|
||||||
'enabled': False,
|
'enabled': True,
|
||||||
'needs': {
|
'needs': {
|
||||||
'file:/usr/local/lib/systemd/system/steam-update.service',
|
'file:/usr/local/lib/systemd/system/steam-update.service',
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
'bundles': [
|
'bundles': [
|
||||||
'apt',
|
'apt',
|
||||||
'nftables',
|
'nftables',
|
||||||
|
'pip',
|
||||||
],
|
],
|
||||||
'metadata': {
|
'metadata': {
|
||||||
'apt': {
|
'apt': {
|
||||||
|
|
Loading…
Reference in a new issue