This is an Ansible playbook that:
- create an instance of the desired type using OVH API;
- install a Minecraft server on it, alongside a list of required plugins that can be installed either from
Spigot (using Spiget), from a direct link to a JAR file, or from a repository that
can be installed using
mvn clean install
; - start the server on the default port;
- op listed players;
- add a DNS record, so the server can be accessed.
The playbook is currently tided to the Zcraft DNS and OVH accounts but that may evolve in the future. There is not so much to change to have fully-configurable zone, most is already configurable anyway, and everything will eventually be added to the vault file.
To create a server, clone the repository, then run:
ansible-playbook playbook.yml --extra-vars="game=ktz dns=game-name" --ask-vault-pass
After a while, you'll be given the server IP and players will be able to join using game-name.games.zcraft.fr
(or
other domain if that was modified).
The game
var is a configuration file stored in vars/games/<name>.yml
, containing what need to be done
on the server. See vars/games/ktz.yml
for an example.
The dns
var is the sub-domain of games.zcraft.fr
that will be created for this game instance.
This playbook cannot delete the server, nor the associated DNS records. You have to do that yourself at the end of the event, using the OVH Manager.