GithubHelp home page GithubHelp logo

vlcty / ansible-role-insurgency-sandstorm-gameserver Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 23 KB

Setup Insurgency Sandstorm Gameservers on Linux using ansible

License: GNU General Public License v3.0

Shell 100.00%
ansible-role ansible insurgency sandstorm gameserver gameserver-tool automation

ansible-role-insurgency-sandstorm-gameserver's Introduction

ansible-role-insurgency-sandstorm

Deploy Insurgency Sandstorm gameservers on Linux with ansible!

Variables

Global variables

See defaults/main.yml for a commented list of predefined variables.

Example config

Here is an complete example config in my host_vars folder for my gameserver:

sandstorm_servers:
    coop:
        sandstorm_servername: More or less hardcore coop # mandatory
        sandstorm_server_start_map: Farmhouse # mandatory
        sandstorm_start_scenario: Scenario_Farmhouse_Checkpoint_Security # mandatory
        sandstorm_port: 27333 # mandatory
        sandstorm_admins: # optional
            - 76561198003172459 # veloc1ty
        sandstorm_bans: # optional
            - 76561197987793486
        sandstorm_mapcycle: # optional
            - Scenario_Crossing_Checkpoint_Security
            - Scenario_Hideout_Checkpoint_Security
            - Scenario_Precinct_Checkpoint_Security
            - Scenario_Refinery_Checkpoint_Security
            - Scenario_Farmhouse_Checkpoint_Security
            - Scenario_Summit_Checkpoint_Security
        sandstorm_config: | # mandatory
            [/script/insurgency/insurgency.insgamemode]
            ObjectiveSpeedup=0.5

            [/script/insurgency.insmultiplayermode]
            InitialSupply=25
            PostRoundTime=3
            FriendlyFireModifier=1.0
            FriendlyFireReflect=0.9

            [/script/insurgency.inscoopmode]
            bUseVehicleInsertion=False
            MinimumEnemies=6
            MaximumEnemies=20

Every key in the dictionary sandstorm_servers is a gameserver. Add more keys with different names to spawn more. In my example only the gameserver "coop" will be created. I currently only have one.

The config for each server should be self explaining. Most of the variables are mandatory.

Tool: steamid.io

Admin Steam IDs have to be in the SteamID64 format. You can convert a profile URL to SteamID64 using this online tool: https://steamid.io/

Note: 32bit libs

On 64 bit systems some 32 bit libs have to be installed. Insurgency Sandstorm is a 64bit executable, but steamcmd is not. Blame Steam for that.

On Archlinux you have to activat the multilib repo. Open /etc/pacman.conf and uncomment the following block:

[multilib]
Include = /etc/pacman.d/mirrorlist

Then install the 32 bit gcc libs:

pacman -Syu lib32-gcc-libs

Documentation: https://wiki.archlinux.org/index.php/official_repositories#Enabling_multilib

You can also do this with ansible:

- name: Enabling multilib
  blockinfile:
    path: /etc/pacman.conf
    block: |
        [multilib]
        Include = /etc/pacman.d/mirrorlist
    state: present

- name: Install lib32-gcc-libs
  pacman:
     name: lib32-gcc-libs
     state: present
     update_cache: true

On Ubuntu you need to enable the i386 architecture and install the lib32gcc1 package. In your playbook add this:

- name: Enable i386 arch
  command: dpkg --add-architecture i386
  
- name: 32bit steamcmd support
  apt:
    name: lib32gcc1
    state: present
    update_cache: true

Supported distributions

I've developed this role against Archlinux. All other distributions should also work.

Developer Documentation

setuid bit on steamcmd

I set the setuid bit on the steamcmd binary to run with the user rights. This is because changing running user in ansible is not very good looking. The setuid bit helps here.

Why not calling the gameserver binary directly in the systemd service

My first approach was to call the binary directly in the ExecStart key in the systemd service file. But systemd didn't want to load the file because of the ? character in the binary name. Escaping it didn't help. So I had to go the way around it using a startscript.

Further reading

Read this google document: https://docs.google.com/document/d/1GDLg5p9jjeIya7EgBk0ibzDtDlyQ-U_jpspOzby-JmM/edit

or my blogpost: https://blog.veloc1ty.de/2018/12/09/starting-a-dedicated-insurgency-sandstorm-server-on-linux/

ansible-role-insurgency-sandstorm-gameserver's People

Contributors

giacmir avatar vlcty avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

giacmir jkeene32

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.