diff --git a/README.md b/README.md index 9b3901d1..487899fe 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ If you have a spare domain name you can configure applications to be accessible * [Krusader](https://krusader.org/) - Twin panel file management for your desktop * [Lidarr](https://github.com/lidarr/Lidarr) - Music collection manager for Usenet and BitTorrent users * [Mealie](https://hay-kot.github.io/mealie/) - A self-hosted recipe manager and meal planner +* [Minecraft Server](https://www.minecraft.net/) - Server edition of the popular building and exploring game * [MiniDLNA](https://sourceforge.net/projects/minidlna/) - simple media server which is fully compliant with DLNA/UPnP-AV clients * [Miniflux](https://miniflux.app/) - An RSS news reader * [Mosquitto](https://mosquitto.org) - An open source MQTT broker @@ -61,7 +62,7 @@ If you have a spare domain name you can configure applications to be accessible * [Ombi](https://ombi.io/) - web application that automatically gives your users the ability to request content * [Organizr](https://organizr.app/) - ORGANIZR aims to be your one stop shop for your Servers Frontend. * [openHAB](https://www.openhab.org/) - A vendor and technology agnostic open source automation software for your home -* [Paperless_ng](https://github.com/jonaswinkler/paperless-ng) - Scan, index and archive all your physical documents +* [Paperless_ng](https://github.com/jonaswinkler/paperless-ng) - Scan, index and archive all your physical documents * [Piwigo](https://piwigo.org/) - Photo Gallery Software * [Plex](https://www.plex.tv/) - Plex Media Server * [Portainer](https://portainer.io/) - for managing Docker and running custom images diff --git a/docs/applications/minecraft.md b/docs/applications/minecraft-server.md similarity index 77% rename from docs/applications/minecraft.md rename to docs/applications/minecraft-server.md index e65e0fc4..60f7c895 100644 --- a/docs/applications/minecraft.md +++ b/docs/applications/minecraft-server.md @@ -1,12 +1,12 @@ # Minecraft Server -Homepage: [https://www.minecraft.net](https://www.minecraft.net) +Homepage: [https://www.minecraft.net/](https://www.minecraft.net/) The server version of the game Minecraft, running in a container. "Prepare for an adventure of limitless possibilities as you build, mine, battle mobs, and explore the ever-changing Minecraft landscape." ## Usage -Set `minecraft_enabled: true` in your `inventories//nas.yml` file. +Set `minecraft_server_enabled: true` in your `inventories//nas.yml` file. The Ansible NAS host or ip address should then be usable as a server within the Minecraft multiplayer game menu. diff --git a/nas.yml b/nas.yml index 8d061b3a..0fcba1ed 100644 --- a/nas.yml +++ b/nas.yml @@ -168,10 +168,10 @@ - mealie when: (mealie_enabled | default(False)) - - role: minecraft + - role: minecraft-server tags: - - minecraft - when: (minecraft_enabled | default(False)) + - minecraft-server + when: (minecraft_server_enabled | default(False)) - role: minidlna tags: diff --git a/roles/minecraft-server/defaults/main.yml b/roles/minecraft-server/defaults/main.yml new file mode 100644 index 00000000..95e0ccf0 --- /dev/null +++ b/roles/minecraft-server/defaults/main.yml @@ -0,0 +1,9 @@ +--- +minecraft_server_enabled: false + +# directories +minecraft_server_data_directory: "{{ docker_home }}/minecraft" + +# network +minecraft_server_port: "25565" + diff --git a/roles/minecraft-server/tasks/main.yml b/roles/minecraft-server/tasks/main.yml new file mode 100644 index 00000000..b3d721fb --- /dev/null +++ b/roles/minecraft-server/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: Create Minecraft Server Directories + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ minecraft_server_data_directory }}" + +- name: Minecraft Server Docker Container + docker_container: + name: minecraft-server + image: itzg/minecraft-server:latest + pull: true + volumes: + - "{{ minecraft_server_data_directory }}:/data:rw" + ports: + - "{{ minecraft_server_port }}:25565" + env: + EULA: "TRUE" + restart_policy: unless-stopped diff --git a/roles/minecraft/defaults/main.yml b/roles/minecraft/defaults/main.yml deleted file mode 100644 index 88f3a060..00000000 --- a/roles/minecraft/defaults/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -minecraft_enabled: false - -# directories -minecraft_data_directory: "{{ docker_home }}/minecraft" - -# network -minecraft_port: "25565" - diff --git a/roles/minecraft/tasks/main.yml b/roles/minecraft/tasks/main.yml deleted file mode 100644 index 6e571806..00000000 --- a/roles/minecraft/tasks/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Create Minecraft Directories - file: - path: "{{ item }}" - state: directory - with_items: - - "{{ minecraft_data_directory }}" - -- name: Minecraft Docker Container - docker_container: - name: minecraft - image: itzg/minecraft-server:latest - pull: true - volumes: - - "{{ minecraft_data_directory }}:/data:rw" - ports: - - "{{ minecraft_port }}:25565" - env: - EULA: "TRUE" - restart_policy: unless-stopped