- Jinja 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| defaults | ||
| meta | ||
| tasks | ||
| templates | ||
| .gitignore | ||
| CHANGELOG.md | ||
| LICENSE | ||
| README.md | ||
teamspeak
Deploys a TeamSpeak 3 server via Docker Compose, using the official image (docker.io/library/teamspeak, maintained by TeamSpeak Systems) with its built-in SQLite database. Single container, no reverse proxy: voice and file transfer are published directly.
Requirements
- Docker
community.dockerAnsible collection- Firewall/port forward for the voice port (UDP) and the file transfer port (TCP)
Variables
| Variable | Default | Description |
|---|---|---|
teamspeak_instance |
teamspeak |
Compose project name and container name prefix. |
teamspeak_data_path |
/data/teamspeak |
Host path mounted as /var/ts3server (SQLite database, files, logs). |
teamspeak_docker_path |
/docker/teamspeak |
Host path for the compose.yml file. |
teamspeak_version |
3.13.9 |
Image tag. Never go below the version that last ran on the data (the server migrates its database). |
teamspeak_license_accepted |
false |
Must be set to true by you after reading the license. The role refuses to deploy otherwise. |
teamspeak_serveradmin_password |
~ |
Password of the serveradmin ServerQuery account. Required. Applied on every start. |
teamspeak_bind_ip |
"" |
Host address the public ports are published on. Empty = all. |
teamspeak_voice_port |
9987 |
Host port for voice (UDP). |
teamspeak_filetransfer_port |
30033 |
Host port for file transfers (TCP). |
teamspeak_query_port |
~ |
When set, publishes the raw ServerQuery on 127.0.0.1:<port> only. |
teamspeak_env |
{} |
Extra environment variables (image docs), overriding the role's own. |
teamspeak_uninstall |
false |
Stops and removes the container and the compose directory. |
teamspeak_purge |
false |
Also removes the data directory. Requires teamspeak_uninstall: true. Irreversible. |
Read the license with docker run --rm -e TS3SERVER_LICENSE=view teamspeak:3.13.9.
Usage
- hosts: ts01
become: true
roles:
- role: teamspeak
vars:
teamspeak_license_accepted: true
teamspeak_serveradmin_password: "{{ vault_teamspeak_serveradmin_password }}"
On the very first start (empty data directory) the server creates a one-time ServerAdmin privilege key; the role prints it. Connect with a client and redeem it under Permissions > Use Privilege Key. The key is also in docker logs <instance>-server until the container is recreated.
Design notes
- SQLite (the image default): one container, nothing to keep in sync. The image ships without the MariaDB client library, so the MariaDB plugin doesn't work with it anyway.
- Ports published directly: TeamSpeak needs the clients' real addresses for bans and flood protection, and voice is UDP. No Traefik.
- ServerQuery stays internal unless
teamspeak_query_portis set, and then only on127.0.0.1. Raw query is plain text: never expose it. - Shutdown:
stop_grace_period: 60sgives the server time to flush the database on SIGTERM. - Health: the healthcheck connects to the file transfer port inside the container.
- Images are pulled in their own step before
up: whendocker compose uppulls an image itself, Compose v5.4 recreates the container once more on the next run.
Backup
Back up the whole data directory. For a consistent copy of ts3server.sqlitedb while the server runs, use sqlite3 ts3server.sqlitedb ".backup /path/backup.sqlitedb" on the host, or stop the container briefly.