~tleguern/ansible-role-sourcemod

Install and configure SourceMod, the Half-Life 2 engine server modification
Remove the 'v' prefix in requirements.yml's versions
Switch to Debian buster
Fix molecule's requirements

clone

read-only
https://git.sr.ht/~tleguern/ansible-role-sourcemod
read/write
git@git.sr.ht:~tleguern/ansible-role-sourcemod

You can also use your local clone with git send-email.

#Ansible Role: sourcemod

builds.sr.ht status

An Ansible role that installs and configures SourceMod, a Metamod:Source plugin.

Automatic testing is provided using molecule's delegated driver and https://builds.sr.ht.

#Requirements

An ansible role dedicated to the installation of SteamCMD such as ansible-steamcmd or any role providing the {{ steamcmd_user }} variable.

An ansible role dedicated to the installation of a Source mod such as ansible-role-cstrike-source or any role providing the Restart {{ metamod_source_game }} handler.

An ansible role dedicated to the Installation of Metamod:Source such as ansible-role-metamod-source, or any role providing the {{ metamod_source_install_path }},

#Role Variables

Variable Description Default
steamcmd_user User name for steamcmd steam
sourcemod_url URL pointing to sourcemod releases https://sm.alliedmods.net/smdrop
sourcemod_branch Release branch (should generally be the same as {{ metamod_source_branch }} 1.11
metamod_source_install_path Installation directory mandatory
sourcemod_admins_simple SourceMod admin declaration via the flat file format See bellow
sourcemod_plugins List of plugins to enable or disable See bellow

#sourcemod_admins_simple

A list of hashes containing the identity and flags of any server administrator. Optionnaly immunity levels and password can be suplied.

Key Description
identity A SteamID3 formatted SteamID, a bang-prefixed IP address or a simple name
flags Letter encoded permission levels
immunity Immunity level
password Password, only for somple name identity

More information here.

Example:

sourcemod_admins_simple:
  - identity: STEAM_0:1:16
    flags: bce
  - identity: "!127.0.0.1"
    immunity: "99"
    flags: z
  - identity: BAILOPAN
    flags: abc
    password: Gab3n

#sourcemod_plugins

Allows to install, remove, enable or disable plugins.

Key Description
name The plugin's name without file suffix
state Only absent, disabled or enabled

If the state is either disabled or enabled and the variable sourcemod_extra_plugins_directory is not an empty string the corresponding plugin will be looked for as {{ sourcemod_extra_plugins_directory }}/{{ plugin.name }}.smx and uploaded on the remote server.

Example:

sourcemod_plugins:
  - name: funcommands
    state: disable
  - name: unwanted
    state: absent
  - name: swapteam
    state: enabled

#Dependencies

None

#Example Playbook

- hosts: game
  vars:
   sourcemod_admins_simple:
     - identity: STEAM_0:1:16
       flags: z
  roles:
    - role: ansible-steamcmd
    - role: ansible-role-cstrike-source
    - role: ansible-role-metamod-source
    - role: ansible-role-sourcemod

#License

ISC

#Contributing

Either send send GitHub pull requests or send patches on SourceHut.

#Author Information

Tristan Le Guern tleguern@bouledef.eu