Giter Site home page Giter Site logo

terraform-csgo-server's Introduction

CSGo Automated Server Launch in GCloud

Create an ubuntu 18 server with CSGo Server installed and configured. Uses crazy-max/csgo-server-launcher. More documentation to come.

Usage

Prerequisites

Create a GCloud project, edit the name in provider.tf

Configuration

Create the file secret.auto.tfvars in the project root. Populate it with the minimum config (below) and any ssh keys you'd like added.

csgo-instance-ssh-keys = [
  "user:ssh-rsa blahblahblah== name"
]

screen-name = "screenName"
steam-login = "myLogin"
steam-password = "myPassword"
gslt = "myLoginCode"

tickrate = "128"
maxplayers = "4"

Optionally, configure a GCS remote backend to store your terraform state.

terraform {
  backend "gcs" {
    bucket = "terraform-csgo-state"
    project = "terraform-csgo"
  }
}

See variables.tf for other configuration options.

Authenticate

Authenticate with gcloud OAuth.

gcloud auth application-default login

Run Terraform

The example below runs apply and init from a docker container. The volume syntax used assumes Linux or MacOS. You can also use a native installation, see the Terraform documentation for more information.

You can consider running these in Google Cloud Shell if you don't have a linux environment readily available.

docker run -it -v $PWD:/tf \
  -w /tf \
  -v $HOME/.config/gcloud/application_default_credentials.json:/credentials.json:ro\
  -e GOOGLE_APPLICATION_CREDENTIALS=/credentials.json \
  hashicorp/terraform init

docker run -it -v $PWD:/tf \
  -w /tf \
  -v $HOME/.config/gcloud/application_default_credentials.json:/credentials.json:ro\
  -e GOOGLE_APPLICATION_CREDENTIALS=/credentials.json \
  hashicorp/terraform apply

Wait for install to complete

A startup script will automatically run on the host to install and configure the CSGo server. This will likely take 20-30 minutes.

Log files

/var/log/syslog contains basic progress information.
/var/log/csgo-install-debug.log contains more detailed progress and debugging info.

Start and Manage Server

The install script can be rerun to update the server config by rerunning terraform apply and rebooting the server.

If you'd prefer to manage this manually, consider running touch /etc/csgo-server-launcher/.no-update to prevent the startup script from overwriting manually edited config values. See crazy-max/csgo-server-launcher documentation for information on manually managing the server after provisioning it.

A Config Management tool may be used in the future to manage the file and service.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.