Skip to content

Chef Cookbook to prepare a server to host TF2 matches

Notifications You must be signed in to change notification settings

chrissands/chef-tf2-server

 
 

Repository files navigation

tf2-server Cookbook

This cookbook will prep your server to be a Team Fortress 2 server.

Note: The default recipe will only prep your server to host tf2. You will still need to login and perform ./update.sh from the home directory to actually perform the initial TF2 installation.

Recipes

default.rb

Creates user and group on the target system and downloads steam client under users home directory. Installs prerequisite packages and adds in any specified public keys to authorized_keys. After this we download and extract the steam client into the users home directory. Additionally, we enable a crontab entry for updating the tf2 installation every Monday at 10pm.

Attributes

tf2-server::default

Key Type Description Default
['user'] String user tf2-server
['group'] String group tf2-server
['ssh']['public_keys'] Array array for ssh public keys for game server user empty
['packages']['debian'] Array array of prequisite packages to install for steam on debian platforms 'lib32gcc1', 'ia32-libs'
['packages']['rhel'] Array array of prequisite packages to install for steam on rhel platforms 'libgcc.i686', 'glibc.i686'
['beta']['enable'] Boolean toggle switch for enabling beta server false
['steam']['install_dir'] String installation directory for steam /home/tf2-server/Steam
['tf2']['install_dir'] String installation directory for tf2 /home/tf2-server/tf2
['steam_cmd']['url'] String url to download steam_cmd from http://media.steampowered.com/client/steamcmd_linux.tar.gz
['update']['enable'] Boolean toggle switch for auto-update via cron true

update attributes

Default is enabled and set to run every Monday at 10pm.

Key Type Description Default
['enable'] Boolean toggle auto-update via cron true
['cron']['command'] String command to run in crontab /home/tf2-server/./update.sh
['cron']['minute'] Integer 0-59 0
['cron']['hour'] Integer 0-23 22
['cron']['day'] Integer 1-31 *
['cron']['month'] Integer or String 1-12 or Jan-Dec *
['cron']['weekday'] 0-6 or Sat-Sun Day of Week 1

Usage

Vagrant

Make sure you have vagrant, vagrant-berkshelf and vagrant-omnibus installed. Then just vagrant up!

Chef

{
  "name":"my_node",
  "run_list": [
    "recipe[tf2-server]"
  ]
}

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors: [email protected]

About

Chef Cookbook to prepare a server to host TF2 matches

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 92.9%
  • Shell 5.1%
  • HTML 2.0%