An Ansible role that installs and configures a Counter-Strike: Source dedicated server.
The game server is downloaded through Steam and exposed as a systemd service for easier management. Using this role it is possible to publish a minimalist server with custom maps. For more advanced configuration it is necessary to install Metamod:Source and SourceMod.
Automatic testing is provided using molecule's delegated driver and https://builds.sr.ht.
An ansible role dedicated to the installation of SteamCMD such as tleguern.steamcmd.
This role should provide the steam_home
variable, pointing to such a folder as /home/steam/Steam
or /home/steam/.steam
depending on your operating system.
The collection ansible.posix
.
Variable | Description | Default |
---|---|---|
steamcmd_user |
User name for steamcmd | steam |
steamcmd_bin |
Path to the steamcmd executable | /usr/games/steamcmd |
cstrike_source_motd |
HTML text for the server's MOTD | See below |
cstrike_source_mapcycle |
List of maps for the rotation | See below |
cstrike_source_server_cfg |
Server configuration | See below |
cstrike_source_port |
Network port | 27015 |
cstrike_source_ip |
IP address to listen on | 0.0.0.0 |
cstrike_source_extra_mapcycles |
Configuration of extra mapcycle | See below |
cstrike_source_extra_maps_directory |
Directory containing extra bsp and nav files | "" |
The MOTD is a welcome text displayed by the server during the first connexion of a player. It is formatted in HTML.
Default value:
<html>
<head>
<title>Counter-Strike: Source</title>
</head>
<body scroll="no">
<pre>Who needs Global Offensive anyway?</pre>
</body>
</html>
The mapcycle file is a simple list of maps loaded on the server.
There is no default value.
Example:
cs_italy
de_dust2
de_aztec
cs_office
de_piranesi
The server.cfg file is the main configuration file for the server. It holds the server name, the administrator password as well as various rules.
There is no default value.
Example:
hostname "My Counter-Strike Server"
rcon_password mypassword
mp_friendlyfire 1
mp_allowNPCs 0
mp_autoteambalance 1
A list of hashes containing two keys: name
and content
.
The first will be used as a prefix to form a new mapcycle file named mapcycle_{{ name }}.txt
and containing {{ content }}
.
Example:
cstrike_source_extra_mapcycles:
- name: deathrun
content: |
deathrun_temple
deathrun_goldfever
- name: dustonly
content: |
de_dust
de_dust2
These files can later be used with rcon, using the mapcyclefile
CVAR.
The acl
package should be installed on the server.
- hosts: game
vars:
cstrike_source_extra_maps_directory: "files/cstrike-source/maps"
cstrike_source_server_cfg: |
hostname "My Server"
sv_password password
rcon_password rconpassword
cstrike_source_mapcycle: |
de_dust2
de_aztec
cs_office
pre_tasks:
- package:
name: acl
state: present
roles:
- role: tleguern.steamcmd
- role: tleguern.cstrike_source
ISC
Either send send GitHub pull requests or send patches on SourceHut.
Tristan Le Guern [email protected]