Skip to content

Farm8763/salty_l4d2_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dedicated L4D2 Server + Elasticstack Monitoring

With custom maps, 5 player coop and 5v5 versus

Building on some groundwork by @Mustack , this project automated the creation of a L4D2 Dedicated server. With the 2020 pandemic we started playing more L4D2 and found documentation for setting up a dedicated server severely lacking/outdated. This project will setup a server with some select custom maps, 5 player coop and 5v5 versus. Modify /srv/salt/top.sls if you don't want every mod deployed.

Setting up salt master

Note: You need a Salt Master to run this project. Recommended CentOS 7.

  • Follow the procedures on the Saltstack page Saltstack Package Repo make sure to select the correct tab for CentOS 7. This was only tested/ran on CentOS 7.
  • You definitely need salt-master and salt-cloud, you might need salt-api and salt-ssh
  • Checkout the project files into their specific folders

Spinning up a DigitalOcean droplet

  • You need to set up ssh keys with digitalocean, as well as access keys. See Digital Ocean Tutorial for advice
  • Add your missing values to /etc/salt/cloud.providers.d/digitalocean.conf

Command to spin up a droplet (dev droplet)

salt-cloud -P -m /etc/salt/cloud.maps.d/dev-environment.map -l debug

Deploying L4D2 server to minion

Note: If you spun up the DigitalOcean droplet with the code above, it's already a minion. Otherwise you're on your own.

  • You need the Steam Group ID when deploying the server (below). To get the value for your group, in the 'Edit group profile' the 'ID' is the group number you need for the server
  • Clients need to subscribe to the workshop maps Steam Workshop Collection or they can't connect when using a custom map.
  • Workshop files were too big for Github to be uploaded. They need to go into /srv/salt/l4d2-mods/workshop on the salt master. See Google Drive with big files
  • Same with missing_content.vpk, it needs to go into /srv/salt/l4d2-mods/missing_content.vpk on the salt master

Deploy

Note: Ran on the salt master

Minimum to deploy

salt '*' state.highstate pillar='{"steamgroup": "<steamgroup #>"}'

Eg: salt '*' state.highstate pillar='{"steamgroup": "12345678"}'

Optionally, you can pass in server_mode and max_players for L4D2 as well. For Elastic monitoring, it's recommended to provide a default password

salt '*' state.highstate pillar='{"steamgroup": "<steamgroup #>", "max_player_count": "<number of players>", "server_mode":"<coop|versus>", "bootstrap_pass": "<password>"}'

Eg: salt '*' state.highstate pillar='{"steamgroup": "12345678", "max_player_count": "7", "server_mode":"coop", "bootstrap_pass": "Solarwinds123"}'

Starting the L4D2 server after deployed

Note: Currently ran on the minion after sshing in as the steam user

/home/steam/L4D2/srcds_run -console -game left4dead2 -gamestatsloggingtofile -condebug -developer -dev

Kibana

Note: Kibana currently deploys with a self-signed cert

Kibana is deployed at https://<monitoring_server_ip>:5601/ , you can log in with the user 'elastic' and the password you provided above.

Filebeat will be deployed to the L4D2 server, and the ingest pipeline will be set up automatically in Kibana/Elasticsearch to parse the incoming logs.

Sample visualizations

Note: Names have been changed

Kill/Death Stats

kills

More Kill/Death Stats

more_kill

Tracking who killed who

revenge

Weapon Damage Word Cloud

word_damage

Zombie Weapon Stats

zomb_weapons

The weapons that killed you

killed_by

Your top weapons

7weapons

External Dependancies

Note: Fetched automatically or included

Resources

TODO

  • Run the server as a service
  • Salt doesn't seem to support SSH key file passwords

About

This project automates the creation of a L4D2 Dedicated server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published