{"id":26414216,"url":"https://github.com/borisskert/ansible_minecraftserver","last_synced_at":"2026-04-11T21:47:34.360Z","repository":{"id":104037328,"uuid":"363414716","full_name":"borisskert/ansible_minecraftserver","owner":"borisskert","description":"Ansible role to install a minecraft server","archived":false,"fork":false,"pushed_at":"2024-12-19T16:23:39.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-19T17:25:48.697Z","etag":null,"topics":["ansible","ansible-role","docker","docker-compose","minecraft","minecraft-server","minecraftserver","systemd","systemd-service","systemd-unit"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borisskert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-01T13:19:05.000Z","updated_at":"2024-12-19T16:23:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba3ffb60-e9a6-4b40-8313-3133f7ea1a74","html_url":"https://github.com/borisskert/ansible_minecraftserver","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible_minecraftserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible_minecraftserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible_minecraftserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisskert%2Fansible_minecraftserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borisskert","download_url":"https://codeload.github.com/borisskert/ansible_minecraftserver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130273,"owners_count":20402753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","docker","docker-compose","minecraft","minecraft-server","minecraftserver","systemd","systemd-service","systemd-unit"],"created_at":"2025-03-17T23:58:14.746Z","updated_at":"2026-04-11T21:47:29.307Z","avatar_url":"https://github.com/borisskert.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible_minecraftserver\n\nThis is an [ansible role](https://docs.ansible.com/) to install a [minecraft server](https://www.minecraft.net/de-de/download/server) as\n[docker container](https://www.docker.com/) controlled by [systemd](https://systemd.io/).\n\nI'm using [itzg's docker image](https://github.com/itzg/docker-minecraft-server). Thanks for your great work!\n\n## System requirements\n\n* Docker\n* docker-compose\n* Systemd\n\n## Role requirements\n\n* (none, so far)\n\n## Tasks\n\n* Template docker-compose file environment\n* Create data volume directory for docker container\n* Setup systemd unit file\n* Start/Restart systemd service\n\n## Role parameters\n\n| Variable                              | Type          | Mandatory? | Default                               | Description                                                                                                                  |\n|---------------------------------------|---------------|------------|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| minecraftserver_state                 | text          | no         | `'present'`                           | If `absent` removes the docker configuration and systemd service                                                             |\n| minecraftserver_image_version         | text          | no         | `'latest'`                            | itzg's Docker image version                                                                                                  |\n| minecraftserver_version               | text          | no         | `''`                                  | Minecraft Server version (e.g. `1.16.5`, default: latest version will be downloaded)                                         |\n| minecraftserver_interface             | text          | no         | `0.0.0.0`                             | Mapped network interface                                                                                                     |\n| minecraftserver_port                  | text          | no         | `25565`                               | Mapped network port                                                                                                          |\n| minecraftserver_data_volume_directory | text          | no         | `/srv/minecraftserver/minecraft-data` | Location of your data volume directory                                                                                       |\n| minecraftserver_environment           | key-value map | no         | `{}`                                  | Specifies the environment for the docker image (See [itzg's documentation](https://github.com/itzg/docker-minecraft-server)) |\n| minecraftserver_force_remove          | boolean       | no         | `false`                               | Only for state `absent`: Specifies if your data volume directory will be deleted on when uninstalling                        |\n\n## Example Playbook\n\n### Add to `requirements.yml`:\n\n```yaml\n- name: install-minecraftserver\n  src: https://github.com/borisskert/ansible_minecraftserver.git\n  scm: git\n```\n\n### Example `playbook.yml`:\n\n```yaml\n- hosts: servers\n  roles:\n    - role: install-minecraftserver\n      minecraftserver_state: present\n      minecraftserver_image_version: latest\n      minecraftserver_version: '1.16.5'\n      minecraftserver_interface: 0.0.0.0\n      minecraftserver_port: 25565\n      minecraftserver_data_volume_directory: /srv/minecraftserver/minecraft-data\n      minecraftserver_environment:\n        SEED: 1785852800490497919\n        VIEW_DISTANCE: 10\n        MODE: creative\n        MOTD: My super cool MC server\n```\n\n### Example `playbook.yml` for uninstall:\n\n```yaml\n- hosts: servers\n  roles:\n    - role: install-minecraftserver\n      minecraftserver_state: absent\n      minecraftserver_force_remove: true\n```\n\n## Testing\n\nRequirements:\n\n* [Vagrant](https://www.vagrantup.com/)\n* [Qemu](https://www.qemu.org/libvirt) and [libvirt](https://libvirt.org/)\n* [Ansible](https://docs.ansible.com/)\n* [Molecule](https://molecule.readthedocs.io/en/latest/index.html)\n* [yamllint](https://yamllint.readthedocs.io/en/stable/#)\n* [ansible-lint](https://docs.ansible.com/ansible-lint/)\n* [Docker](https://docs.docker.com/)\n\n### Run within docker\n\n```shell script\nmolecule test \u0026\u0026 molecule test --scenario-name all-parameters \u0026\u0026 molecule test --scenario-name state-absent \u0026\u0026 molecule test --scenario-name with-environment \u0026\u0026 molecule test --scenario-name state-absent-force-remove-persistent-data\n```\n\n### Run within Vagrant\n\n```shell script\nmolecule test -s vagrant-default \u0026\u0026 molecule test -s vagrant-all-parameters \u0026\u0026 molecule test --scenario-name vagrant-state-absent \u0026\u0026 molecule test --scenario-name vagrant-with-environment \u0026\u0026 molecule test --scenario-name vagrant-state-absent-force-remove-persistent-data\n```\n\nI recommend to use [pyenv](https://github.com/pyenv/pyenv) for local testing.\nWithin the GitHub Actions pipeline I use [my own molecule action](https://github.com/borisskert/molecule-action).\n\n## License\n\nMIT\n\n## Author Information\n\n* [borisskert](https://github.com/borisskert)\n\n## Further links\n\n* [itzg/docker-minecraft-server (Github)](https://github.com/itzg/docker-minecraft-server)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborisskert%2Fansible_minecraftserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborisskert%2Fansible_minecraftserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborisskert%2Fansible_minecraftserver/lists"}