All Projects → devops-coop → ansible-minecraft

devops-coop / ansible-minecraft

Licence: Apache-2.0 License
Ansible role for provisioning a vanilla Minecraft server

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
ruby
36898 projects - #4 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ansible-minecraft

ansible-docker
Enter description of Ansible role
Stars: ✭ 14 (-73.58%)
Mutual labels:  ansible-role
ansible-role-solita.jenkins
Ansible role: Jenkins, completely configured with Ansible
Stars: ✭ 21 (-60.38%)
Mutual labels:  ansible-role
ansible-github actions runner
Ansible Role to deploy GitHub Actions self-hosted runner
Stars: ✭ 76 (+43.4%)
Mutual labels:  ansible-role
RHEL7-CIS
Ansible RHEL 7 - CIS Benchmark Hardening Script
Stars: ✭ 28 (-47.17%)
Mutual labels:  ansible-role
ansible-role-win updates
Install Windows updates using Ansible.
Stars: ✭ 24 (-54.72%)
Mutual labels:  ansible-role
ansible-role-k8s
This role render an arbitrary number of Jinja2 templates and deploys or removes them to/from Kubernetes clusters.
Stars: ✭ 26 (-50.94%)
Mutual labels:  ansible-role
ansible-role-virtualenv
Ansible role to create and update a Python virtualenv.
Stars: ✭ 22 (-58.49%)
Mutual labels:  ansible-role
ansible-role-go
Ansible role - Go
Stars: ✭ 23 (-56.6%)
Mutual labels:  ansible-role
pvwa
Ansible role to deploy Cyberark Password Vault Web Access
Stars: ✭ 16 (-69.81%)
Mutual labels:  ansible-role
ansible-role-docker-ce
Ansible role to install Docker CE on AlmaLinux/Rocky/CentOS/Fedora/RHEL(Redhat)/Ubuntu/Debian/Mint/Raspbian
Stars: ✭ 73 (+37.74%)
Mutual labels:  ansible-role
ansible-role-create-users
Manage users on Linux using Ansible
Stars: ✭ 73 (+37.74%)
Mutual labels:  ansible-role
ansible-role-zerotier
Ansible role to install Zerotier-One and join a Zerotier network
Stars: ✭ 64 (+20.75%)
Mutual labels:  ansible-role
Ansible-Veeam
My Ansible Playbooks, Roles and Modules for Veeam
Stars: ✭ 21 (-60.38%)
Mutual labels:  ansible-role
ansible-galaxy-pyenv
Ansible Galaxy role for pyenv
Stars: ✭ 56 (+5.66%)
Mutual labels:  ansible-role
lykops
lykops是一套web可视化的运维自动化项目,基于python3+django开发的。可视化、简化执行ansible任务,并提供详细的任务执行报告。
Stars: ✭ 129 (+143.4%)
Mutual labels:  ansible-role
ansible-role-redmine
Ansible Role To Install Redmine
Stars: ✭ 17 (-67.92%)
Mutual labels:  ansible-role
ansible-digitalocean
An ansible role that creates a DigitalOcean droplet and returns the droplet's IP address for further use in playbooks
Stars: ✭ 20 (-62.26%)
Mutual labels:  ansible-role
ansible-ossec-server
Installing and maintaining the ossec-server for RedHat/Debian/Ubuntu.
Stars: ✭ 29 (-45.28%)
Mutual labels:  ansible-role
CIS-Ubuntu-20.04-Ansible
Ansible Role to Automate CIS v1.1.0 Ubuntu Linux 18.04 LTS, 20.04 LTS Remediation
Stars: ✭ 150 (+183.02%)
Mutual labels:  ansible-role
nodejs
Ansible role for nodejs
Stars: ✭ 21 (-60.38%)
Mutual labels:  ansible-role

ansible-minecraft

Install from Ansible Galaxy Travis CI build status Chat on gitter.im

This role installs Minecraft or Spigot and configures it to run under systemd or Supervisor.

If you're viewing this at https://github.com/devops-coop/ansible-minecraft/, you're reading the documentation for the master branch. View documentation for the latest release (3.1.0).

Requirements

  • Optional: Python 2.7 on the Ansible control machine to generate user ACLs
  • Optional: Ansible 2.0.2+ or curl on the control machine to fetch the latest Minecraft version

Install

ansible-galaxy install devops-coop.minecraft

Features

  • supports vanilla Minecraft and Spigot

  • supports Debian 8, Ubuntu 14.04, Ubuntu 16.04, and RHEL/CentOS 7

  • supports different process supervisors on different platforms

    OS

    Supervisor

    systemd

    Debian 8

    Ubuntu 14.04

     

    Ubuntu 16.04

     

    CentOS 7

     

  • safely stops the server using stop when running under systemd

  • uses Docker and Inspec to run integration tests

  • manages user ACLs

  • manages server.properties

  • hooks: include arbitrary tasks at specific stages during execution

Versioning

This project follows semantic versioning.

In the context of semantic versioning, consider the role contract to be defined by the role variables.

  • Changes that require user intervention will increase the major version. This includes changing the default value of a role variable.
  • Changes that do not require user intervention, but add backwards-compatible features, will increase the minor version.
  • Bug fixes will increase the patch version.

Refer to the change log for upcoming changes.

Role variables

The following variable defaults are defined in defaults/main.yml.

minecraft_version

Minecraft version to install (default: latest)

Examples:

minecraft_version: latest
minecraft_version: 1.10
minecraft_version: 1.9.1
minecraft_version: 16w21a
minecraft_url
Minecraft download URL (default: https://s3.amazonaws.com/Minecraft.Download/versions)
minecraft_user
system user Minecraft runs as (default: minecraft)
minecraft_group
system group Minecraft runs as (default: minecraft)
minecraft_home
directory to install Minecraft to (default: /srv/minecraft)
minecraft_max_memory
Java max memory (-Xmx) to allocate (default: 1024M)
minecraft_initial_memory
Java initial memory (-Xms) to allocate (default: 1024M)
minecraft_service_name
systemd service name or Supervisor program name (default: minecraft)
minecraft_supervisor_name
DEPRECATED: Supervisor program name (default: {{ minecraft_service_name }})
minecraft_process_control
Choose between systemd and supervisor (default: systemd).
minecraft_whitelist
list of Minecraft usernames to whitelist (default: [])
minecraft_ops
list of Minecraft usernames to make server ops (default: [])
minecraft_banned_players
list of Minecraft usernames to ban (default: [])
minecraft_banned_ips
list of IP addresses to ban (default: [])
minecraft_server_properties
dictionary of server.properties entries (e.g. server-port: 25565) to set (default: {})
minecraft_server
choose between minecraft or spigot (default: minecraft)

Hooks and run stages

ansible-minecraft organizes execution into a number of run stages:

setup
  • install prerequisites (e.g., Java)
  • create Minecraft user and group
download
  • fetch the latest version of from the launcher API
  • download Minecraft
install
  • symlink version to minecraft_server.jar
  • agree to EULA
acl
  • configure server ACLs (whitelist, banned players, etc.)
configure
  • set server.properties
start
  • (re)start server

You can execute custom tasks before or after specific stages. Simply specify a task include file using the relevant role variable:

- hosts: minecraft
  roles:
    - role: devops-coop.minecraft
      minecraft_hook_before_start: "{{ playbook_dir }}/download-world-from-s3.yml"

The available hooks are:

minecraft_hook_before_setup
run before setup tasks
minecraft_hook_after_setup
run after setup tasks
minecraft_hook_before_download
run before download tasks
minecraft_hook_after_download
run after download tasks
minecraft_hook_before_install
run before install tasks
minecraft_hook_after_install
run after install tasks
minecraft_hook_before_start
run before start tasks
minecraft_hook_after_start
run after start tasks

Example

- hosts: minecraft
  roles:
     - { role: devops-coop.minecraft, minecraft_whitelist: ["jeb_", "dinnerbone"]}

Contributing

The best way to contribute is to use this role to deploy your own Minecraft server! We really appreciate bug reports from the wild.

If you'd like to help with the project itself, here are some other ways you can contribute:

  • Add support for additional servers like Cuberite.
  • Write integration tests for Minecraft- or Spigot-specific configuration.
  • Share useful hooks.

Testing

Testing can be done using the provided Vagrantfile or by installing Docker and Docker Compose locally.

Testing with Vagrant

This role includes a Vagrantfile used with a Docker-based test harness that approximates the Travis CI setup for integration testing. Using Vagrant allows all contributors to test on the same platform and avoid false test failures due to untested or incompatible docker versions.

  1. Install Vagrant and VirtualBox.

  2. Run vagrant up from the same directory as the Vagrantfile in this repository.

  3. SSH into the VM with: vagrant ssh

  4. Run tests with make.

    make -C /vagrant xenial64 test
    

Integration tests use systemd by default. Set PROCESS_CONTROL to change this:

make -C /vagrant trusty64 test PROCESS_CONTROL=supervisor

See make help for more information including a full list of available targets.

Testing with Docker and Docker Compose locally

Alternatively, you can install Docker and Docker Compose to run these tests locally on your machine.

  1. Install Docker and Docker Compose.

  2. Run tests with make.

    make jessie64 test
    

Integration tests use systemd by default. Set PROCESS_CONTROL to change this:

make trusty64 test PROCESS_CONTROL=supervisor

See make help for more information including a full list of available targets.

License

Apache 2.0

Disclaimer

To automate the installation, this role automatically accepts the Minecraft EULA. Be aware that by using this role, you implicitly accept the same EULA.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].