added project zomboid server

This commit is contained in:
2026-09-16 15:11:26 -06:00
parent 004ca50738
commit 6c999f07e8
3 changed files with 60 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
--- ---
# Project Zomboid dedicated server (danixu86 container, SteamCMD-based, B42-ready). # Project Zomboid dedicated server (danixu86 container, SteamCMD-based, B42-ready).
# Players: zomboid.boxswapper.io:16261 (UDP) - direct connect or in-game browser (PUBLIC=true). # PRIVATE server: players direct-connect to zomboid.boxswapper.io:16261 (UDP) and enter the join
# password (zomboid_password). Not listed in the in-game server browser (PUBLIC=false).
# External prerequisites (NOT managed by this repo): # External prerequisites (NOT managed by this repo):
# - Cloudflare A record zomboid.boxswapper.io -> public IP (grey-cloud, like mc.boxswapper.io) # - Cloudflare A record zomboid.boxswapper.io -> public IP (grey-cloud, like mc.boxswapper.io)
# - Router port forwards: UDP 16261-16276 + TCP 27015 (RCON) -> 10.10.0.46 # - Router port forwards: UDP 16261-16276 + TCP 27015 (RCON) -> 10.10.0.46
@@ -11,6 +12,32 @@
state: directory state: directory
mode: '0755' mode: '0755'
# The image (cm2network/steamcmd:root base) owns files in /home/steam as the steam user, uid/gid 1000.
# Pre-seeding dirs with that ownership lets the entry script and server write alongside our ini.
- name: Create Project Zomboid server data dir
ansible.builtin.file:
path: /opt/apps/zomboid/data/Zomboid
state: directory
owner: '1000'
group: '1000'
mode: '0755'
- name: Create Project Zomboid server config directory
ansible.builtin.file:
path: /opt/apps/zomboid/data/Zomboid/Server
state: directory
owner: '1000'
group: '1000'
mode: '0755'
- name: Template Project Zomboid server ini from vars.yml
ansible.builtin.template:
src: zomboid.ini.j2
dest: "/opt/apps/zomboid/data/Zomboid/Server/{{ zomboid_servername }}.ini"
owner: '1000'
group: '1000'
mode: '0644'
- name: Deploy Project Zomboid Server - name: Deploy Project Zomboid Server
containers.podman.podman_container: containers.podman.podman_container:
image: "{{ zomboid_image }}" image: "{{ zomboid_image }}"
@@ -38,6 +65,7 @@
RCONPASSWORD: "{{ zomboid_rcon_password }}" RCONPASSWORD: "{{ zomboid_rcon_password }}"
SERVERNAME: "{{ zomboid_servername }}" SERVERNAME: "{{ zomboid_servername }}"
DISPLAYNAME: "{{ zomboid_displayname }}" DISPLAYNAME: "{{ zomboid_displayname }}"
PASSWORD: "{{ zomboid_password }}"
PUBLIC: "{{ zomboid_public }}" PUBLIC: "{{ zomboid_public }}"
MEMORY: "{{ zomboid_memory }}" MEMORY: "{{ zomboid_memory }}"
SERVERPRESET: "{{ zomboid_preset }}" SERVERPRESET: "{{ zomboid_preset }}"

View File

@@ -0,0 +1,12 @@
# Managed by Ansible (roles/zomboid/templates/zomboid.ini.j2) — local edits are overwritten on re-run.
# Source of truth: zomboid_* variables in vars.yml.
DefaultPort=16261
UDPPort=16262
Public={{ zomboid_public | lower }}
PublicName={{ zomboid_displayname }}
Password={{ zomboid_password }}
MaxPlayers={{ zomboid_max_players }}
PVP={{ zomboid_pvp | lower }}
PauseEmpty={{ zomboid_pause_empty | lower }}
RCONPassword={{ zomboid_rcon_password }}
RCONPort=27015

View File

@@ -89,23 +89,33 @@ minecraft_plugins:
- https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot - https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
## Project Zomboid dedicated server (danixu86 container, SteamCMD-based, B42-ready) ## Project Zomboid dedicated server (danixu86 container, SteamCMD-based, B42-ready)
## Players connect to zomboid.boxswapper.io:16261 (UDP) — direct connect or in-game browser (zomboid_public: true). ## PRIVATE server: not shown in the in-game server browser (zomboid_public: false) — friends must
## direct-connect to zomboid.boxswapper.io:16261 and enter the join password (zomboid_password) once.
## External DNS (not managed here): Cloudflare A record zomboid.boxswapper.io -> public IP (grey-cloud, ## External DNS (not managed here): Cloudflare A record zomboid.boxswapper.io -> public IP (grey-cloud,
## same as mc.boxswapper.io / vpn.boxswapper.io). Router MUST forward UDP 16261-16276 + TCP 27015 (RCON) ## same as mc.boxswapper.io / vpn.boxswapper.io). Router MUST forward UDP 16261-16276 + TCP 27015 (RCON)
## -> 10.10.0.46. Port range covers MaxPlayers=16 (game 16261 + query 16262 + per-slot ports); widen it ## -> 10.10.0.46. Server ini is rendered from roles/zomboid/templates/zomboid.ini.j2 on deploy; the
## if you raise MaxPlayers in <zomboid_servername>.ini. ## published UDP range (16261-16276) covers zomboid_max_players=16 (game 16261 + query 16262 + per-slot ports).
zomboid_host: zomboid.boxswapper.io zomboid_host: zomboid.boxswapper.io
zomboid_ip: 10.10.0.46 zomboid_ip: 10.10.0.46
zomboid_image: docker.io/danixu86/project-zomboid-dedicated-server:latest zomboid_image: docker.io/danixu86/project-zomboid-dedicated-server:latest
## SERVERNAME becomes the config folder/file name — must NOT contain spaces or special characters. ## SERVERNAME becomes the config folder/file name — must NOT contain spaces or special characters.
zomboid_servername: zomboid zomboid_servername: zomboid
zomboid_displayname: "Welcome to our future,...retards" zomboid_displayname: "Boxswapper Zomboid Server"
zomboid_admin_username: admin zomboid_admin_username: admin
## CHANGE THESE before first deploy — ADMINPASSWORD is mandatory on first startup (server fails to boot without it) ## CHANGE THESE before first deploy — ADMINPASSWORD is mandatory on first startup (server fails to boot without it),
## and RCONPASSWORD gates the 27015/tcp admin console. ## RCONPASSWORD gates the 27015/tcp admin console, and zomboid_password is the join password players must enter
zomboid_admin_password: bhb8zGdpqHvgEUTM ## when connecting (leave empty to allow password-less joins).
zomboid_rcon_password: fs5vCfJq3ZMl3V01 zomboid_admin_password: 9QmvIhCPOUcWeV9W
zomboid_public: "true" zomboid_rcon_password: lnaScHaCnB2z8k7D
zomboid_password: DOvNml9VCyeXlJx2
zomboid_public: "false"
## Server ini is rendered from roles/zomboid/templates/zomboid.ini.j2 on every deploy —
## vars.yml is the source of truth for the ini, so edits to these vars re-apply on re-run.
## MaxPlayers must fit the published/forwarded UDP range (16261-16276 = 16 slots); raise the range
## in the role and router forwards if you bump it.
zomboid_max_players: 16
zomboid_pvp: "true"
zomboid_pause_empty: "true"
zomboid_memory: 8g zomboid_memory: 8g
zomboid_preset: apocalypse zomboid_preset: apocalypse