https://github.com/tleguern/ansible-role-cstrike-source
Ansible role for the installation and configuration of a Counter Strike: Source dedicated server.
https://github.com/tleguern/ansible-role-cstrike-source
ansible ansible-role counter-strike-source steam
Last synced: 3 months ago
JSON representation
Ansible role for the installation and configuration of a Counter Strike: Source dedicated server.
- Host: GitHub
- URL: https://github.com/tleguern/ansible-role-cstrike-source
- Owner: tleguern
- License: isc
- Created: 2020-04-20T13:14:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-14T08:14:21.000Z (over 3 years ago)
- Last Synced: 2025-02-28T12:45:32.534Z (8 months ago)
- Topics: ansible, ansible-role, counter-strike-source, steam
- Language: Jinja
- Homepage:
- Size: 30.3 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible Role: Counter-Strike: Source
[](https://builds.sr.ht/~tleguern/ansible-role-cstrike-source?)
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](https://github.com/tleguern/ansible-role-metamod-source) and [SourceMod](https://github.com/tleguern/ansible-role-sourcemod).
Automatic testing is provided using molecule's delegated driver and .
## Requirements
An ansible role dedicated to the installation of SteamCMD such as [tleguern.steamcmd](https://github.com/tleguern/ansible-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`.
## Role Variables
| 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 | `""` |
### `cstrike_source_motd`
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
Counter-Strike: Source
Who needs Global Offensive anyway?
```
### `cstrike_source_mapcycle`
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
```
### `cstrike_source_server_cfg`
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
```
### `cstrike_source_extra_mapcycles`
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.
## Dependencies
The `acl` package should be installed on the server.
## Example Playbook
```yaml
- 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
```
## License
ISC
## Contributing
Either send [send GitHub pull requests](https://github.com/tleguern/ansible-role-cstrike-source) or [send patches on SourceHut](https://lists.sr.ht/~tleguern/misc).
## Author Information
Tristan Le Guern