diff --git a/roles/minecraft/defaults/main.yml b/roles/minecraft/defaults/main.yml index e2b0734..964135f 100644 --- a/roles/minecraft/defaults/main.yml +++ b/roles/minecraft/defaults/main.yml @@ -48,6 +48,12 @@ minecraft_rcon_password: "CHANGEME" # The minecraft container configuration as environment variables (see https://github.com/itzg/docker-minecraft-server) minecraft_config: [] +# This config allows to add new portbindings to the minecraft server, eg. for voicechat. +# +# Example entry: +# - 24454:24454/udp +minecraft_additional_ports: [] + # IPv6 ULA config for the bridge network used by docker-ipv6-nat minecraft_ipv6: enabled: false diff --git a/roles/minecraft/templates/docker-compose.yml b/roles/minecraft/templates/docker-compose.yml index b3f03fb..ef2f869 100644 --- a/roles/minecraft/templates/docker-compose.yml +++ b/roles/minecraft/templates/docker-compose.yml @@ -24,6 +24,9 @@ services: image: docker.io/itzg/minecraft-server:{{ minecraft_image_tag }} ports: - "{{ minecraft_server_port }}:25565" +{% for item in minecraft_additional_ports %} + - "{{ item }}" +{% endfor %} volumes: - "{{ minecraft_data_location }}:/data" environment: