wip
This commit is contained in:
parent
af592c771e
commit
f21998266d
3 changed files with 28 additions and 12 deletions
|
@ -5,11 +5,10 @@ directories = {
|
||||||
'/opt/left4dead2/ems/admin system': {
|
'/opt/left4dead2/ems/admin system': {
|
||||||
'owner': 'steam',
|
'owner': 'steam',
|
||||||
},
|
},
|
||||||
'/opt/left4dead2/addons': {
|
'/opt/left4dead2/left4dead2/cfg': {
|
||||||
'owner': 'steam',
|
'owner': 'steam',
|
||||||
'purge': True,
|
|
||||||
},
|
},
|
||||||
'/etc/left4dead2': {
|
'/opt/left4dead2/addons': {
|
||||||
'owner': 'steam',
|
'owner': 'steam',
|
||||||
'purge': True,
|
'purge': True,
|
||||||
},
|
},
|
||||||
|
@ -42,11 +41,21 @@ for id in node.metadata.get('left4dead2/workshop'):
|
||||||
server_units = set()
|
server_units = set()
|
||||||
for name, config in node.metadata.get('left4dead2/servers').items():
|
for name, config in node.metadata.get('left4dead2/servers').items():
|
||||||
config.pop('port')
|
config.pop('port')
|
||||||
config['sv_steamgroup'] = name
|
config.update({
|
||||||
config['hostname'] = name
|
'hostname': name,
|
||||||
config['sv_steamgroup'] = ','.join(str(gid) for gid in node.metadata.get('left4dead2/steamgroups'))
|
'sv_steamgroup': ','.join(
|
||||||
|
str(gid) for gid in node.metadata.get('left4dead2/steamgroups')
|
||||||
|
),
|
||||||
|
'log': 'on',
|
||||||
|
'sv_logecho': 1,
|
||||||
|
'sv_logfile': 1,
|
||||||
|
'sv_log_onefile': 0,
|
||||||
|
'sv_logbans': 1,
|
||||||
|
'sv_logflush': 0,
|
||||||
|
'sv_logsdir': 'logs', # /opt/left4dead2/left4dead2/logs
|
||||||
|
})
|
||||||
|
|
||||||
files[f'/etc/left4dead2/{name}.cfg'] = {
|
files[f'/opt/left4dead2/left4dead2/cfg/server-{name}.cfg'] = {
|
||||||
'content': '\n'.join(
|
'content': '\n'.join(
|
||||||
f'{key} "{value}"' for key, value in sorted(config.items())
|
f'{key} "{value}"' for key, value in sorted(config.items())
|
||||||
) + '\n',
|
) + '\n',
|
||||||
|
|
|
@ -74,7 +74,7 @@ def server_units(metadata):
|
||||||
'User': 'steam',
|
'User': 'steam',
|
||||||
'Group': 'steam',
|
'Group': 'steam',
|
||||||
'WorkingDirectory': '/opt/left4dead2',
|
'WorkingDirectory': '/opt/left4dead2',
|
||||||
'ExecStart': f'/opt/left4dead2/srcds_run -port {config["port"]} -secure +exec /etc/left4dead2/{name}.cfg',
|
'ExecStart': f'/opt/left4dead2/srcds_run -port {config["port"]} -secure +exec server-{name}.cfg',
|
||||||
'Restart': 'on-failure',
|
'Restart': 'on-failure',
|
||||||
},
|
},
|
||||||
'Install': {
|
'Install': {
|
||||||
|
|
|
@ -7,7 +7,9 @@ users = {
|
||||||
directories = {
|
directories = {
|
||||||
'/opt/steam': {
|
'/opt/steam': {
|
||||||
'owner': 'steam',
|
'owner': 'steam',
|
||||||
'group': 'steam',
|
},
|
||||||
|
'/opt/steam/.steam': {
|
||||||
|
'owner': 'steam',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,17 +18,22 @@ files = {
|
||||||
'content_type': 'download',
|
'content_type': 'download',
|
||||||
'source': 'https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz',
|
'source': 'https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz',
|
||||||
'owner': 'steam',
|
'owner': 'steam',
|
||||||
'group': 'steam',
|
|
||||||
},
|
},
|
||||||
'/opt/steam-workshop-downloader': {
|
'/opt/steam-workshop-downloader': {
|
||||||
'content_type': 'download',
|
'content_type': 'download',
|
||||||
'source': 'https://github.com/SegoCode/swd/releases/download/1.1/swd-linux-amd64',
|
'source': 'https://github.com/SegoCode/swd/releases/download/1.1/swd-linux-amd64',
|
||||||
'owner': 'steam',
|
'owner': 'steam',
|
||||||
'group': 'steam',
|
|
||||||
'mode': '750',
|
'mode': '750',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
symlinks = {
|
||||||
|
# /opt/steam/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory
|
||||||
|
'/opt/steam/.steam/sdk32': {
|
||||||
|
'target': '/opt/steam/linux32',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
actions = {
|
actions = {
|
||||||
'extract_steamcmd': {
|
'extract_steamcmd': {
|
||||||
'command': 'tar xfvz /opt/steam/steamcmd_linux.tar.gz --directory /opt/steam',
|
'command': 'tar xfvz /opt/steam/steamcmd_linux.tar.gz --directory /opt/steam',
|
||||||
|
@ -36,7 +43,7 @@ actions = {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'chown_steamcmd': {
|
'chown_steamcmd': {
|
||||||
'command': 'chown -R steam:steam /opt/steam',
|
'command': 'chown -R steam /opt/steam',
|
||||||
'triggered': True,
|
'triggered': True,
|
||||||
'triggered_by': [
|
'triggered_by': [
|
||||||
'action:extract_steamcmd',
|
'action:extract_steamcmd',
|
||||||
|
|
Loading…
Reference in a new issue